From 31b08654a552e0f0a4b55e379db577d9ccf23318 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 9 Nov 2013 09:26:26 +0100 Subject: [PATCH] use CLOCK_REALTIME_COARSE if available. --- src/gettime.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;