Merge branch 'master' of github:szmoore/MCTX3420
[matches/MCTX3420.git] / server / control.c
index 4342c8c..6ebaba7 100644 (file)
@@ -14,7 +14,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
        char experiment_dir[BUFSIZ]; //Directory for experiment
        char experiment_name[BUFSIZ];
@@ -225,7 +225,7 @@ const char* Control_SetMode(ControlModes desired_mode, void * arg)
                                                path, strerror(errno));
                                        ret = "Couldn't create experiment directory.";
                                } else {
-                                       gettimeofday(&(g_controls.start_time), NULL);
+                                       clock_gettime(CLOCK_MONOTONIC, &(g_controls.start_time));
                                }
                        } else 
                                ret = "Cannot start when not in a stopped state.";
@@ -280,6 +280,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;
 }

UCC git Repository :: git.ucc.asn.au