X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gettime.c;h=15356b1b9227c2b92f7676aae124664647f0e5d1;hp=72fda3f8597e335be2fc4677a208f02db9fa62b7;hb=5bd9c78ce361e3a924013299c53fd823fba05818;hpb=6914f59e5e3560325dc8892c9f77689df7b9aa8b;ds=sidebyside 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); }