diff --git a/src/gettime.h b/src/gettime.h index 13e53c5a..a0f6847f 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -31,7 +31,9 @@ inline static void gettime (struct timespec *t) { -#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME_COARSE) + clock_gettime (CLOCK_REALTIME_COARSE, t); +#elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) clock_gettime (CLOCK_REALTIME, t); #else struct timeval tv;