diff options
Diffstat (limited to 'sysdeps/generic/memusage.h')
-rw-r--r-- | sysdeps/generic/memusage.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/generic/memusage.h b/sysdeps/generic/memusage.h index 400fe23f29..88b291e3fa 100644 --- a/sysdeps/generic/memusage.h +++ b/sysdeps/generic/memusage.h @@ -26,14 +26,14 @@ #endif #ifndef GETTIME -# define GETTIME(low,high) \ - { \ - struct timeval tval; \ - uint64_t usecs; \ - gettimeofday (&tval, NULL); \ - usecs = (uint64_t) tval.tv_usec + (uint64_t) tval.tv_usec * 1000000; \ - low = usecs & 0xffffffff; \ - high = usecs >> 32; \ +# define GETTIME(low,high) \ + { \ + struct timespec now; \ + uint64_t usecs; \ + clock_gettime (CLOCK_REALTIME, &now); \ + usecs = (uint64_t)now.tv_nsec / 1000 + (uint64_t)now.tv_sec * 1000000; \ + low = usecs & 0xffffffff; \ + high = usecs >> 32; \ } #endif |