X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Ftimer.c;h=55f5f9cf2905e82492dbbbdaf9e17d6a9fd5d4bf;hb=743413746c3161a885cd7db1919a4cd90cbf03ff;hp=5383e0e85d06ad0fbac2eb45db10ddb32b60b3dc;hpb=0203f5ed9211a3e0958d83844db32bad7a0e11e7;p=umurmur.git diff --git a/src/timer.c b/src/timer.c index 5383e0e..55f5f9c 100644 --- a/src/timer.c +++ b/src/timer.c @@ -36,12 +36,12 @@ static uint64_t Timer_now() { - struct timeval tv; + struct timespec ts; uint64_t e; - gettimeofday(&tv, NULL); - e = tv.tv_sec * 1000000LL; - e += tv.tv_usec; + clock_gettime(CLOCK_MONOTONIC, &ts); + e = ts.tv_sec * 1000000LL; + e += ts.tv_nsec / 1000LL; //convert to microseconds return e; }