From 5bd9c78ce361e3a924013299c53fd823fba05818 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 3 Feb 2012 12:48:16 +0100 Subject: [PATCH] Use CLOCK_MONOTONIC if we can Signed-off-by: Jens Axboe --- gettime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gettime.c b/gettime.c index 72fda3f8..15356b1b 100644 --- a/gettime.c +++ b/gettime.c @@ -140,7 +140,11 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller) case CS_CGETTIME: { struct timespec ts; +#ifdef FIO_HAVE_CLOCK_MONOTONIC + if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) { +#else if (clock_gettime(CLOCK_REALTIME, &ts) < 0) { +#endif log_err("fio: clock_gettime fails\n"); assert(0); } -- 2.25.1