From: Martin Johansson Date: Sun, 10 Nov 2013 18:42:56 +0000 (+0100) Subject: Merge branch 'ipv4' of github.com:fatbob313/umurmur into ipv4 X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=77d660e915420444be90d37c6530797122d0c156;hp=c7a24ac8471652b8443453d8f02acd7b85a68d60;p=umurmur.git Merge branch 'ipv4' of github.com:fatbob313/umurmur into ipv4 --- 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; }