diff --git a/src/utils.c b/src/utils.c index 4e4efc2c57e..626b4678c1e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "utils.h" @@ -25,9 +26,11 @@ double get_wall_time() double what_time_is_it_now() { - struct timespec now; - clock_gettime(CLOCK_REALTIME, &now); - return now.tv_sec + now.tv_nsec*1e-9; + struct timeval time; + if (gettimeofday(&time,NULL)){ + return 0; + } + return (double)time.tv_sec + (double)time.tv_usec * .000001; } int *read_intlist(char *gpu_list, int *ngpus, int d)