X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fcontrol.c;h=776cdd15df51f668c2e2a6005f7effdf9ab6d9b5;hb=a44dc75609448e871feb189bb81f84411256f52b;hp=c6b582384f2f2fe120b7625ddf38cef6fd4d1240;hpb=e3e7914fe2f59765e5f92371329652a02518928c;p=matches%2FMCTX3420.git diff --git a/server/control.c b/server/control.c index c6b5823..776cdd1 100644 --- a/server/control.c +++ b/server/control.c @@ -12,7 +12,7 @@ typedef struct ControlData { ControlModes current_mode; pthread_mutex_t mutex; - struct timeval start_time; + struct timespec start_time; char user_name[31]; // The user who owns the currently running experiment } ControlData; @@ -201,7 +201,7 @@ const char* Control_SetMode(ControlModes desired_mode, void * arg) FILE *fp = fopen((const char*) arg, "a"); if (fp) { fclose(fp); - gettimeofday(&(g_controls.start_time), NULL); + clock_gettime(CLOCK_MONOTONIC, &(g_controls.start_time)); } else ret = "Cannot open experiment name marker"; } @@ -258,6 +258,6 @@ const char * Control_GetModeName() { * Gets the start time for the current experiment * @return the start time */ -const struct timeval* Control_GetStartTime() { +const struct timespec * Control_GetStartTime() { return &g_controls.start_time; }