diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/ldb/tools/ldbtest.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c index a885b80c72..94dd2c696d 100644 --- a/source4/lib/ldb/tools/ldbtest.c +++ b/source4/lib/ldb/tools/ldbtest.c @@ -45,12 +45,16 @@ static struct ldb_cmdline *options; static void _start_timer(void) { - clock_gettime_mono(&tp1); + if (clock_gettime(CUSTOM_CLOCK_MONOTONIC, &tp1) != 0) { + clock_gettime(CLOCK_REALTIME, &tp1); + } } static double _end_timer(void) { - clock_gettime_mono(&tp2); + if (clock_gettime(CUSTOM_CLOCK_MONOTONIC, &tp2) != 0) { + clock_gettime(CLOCK_REALTIME, &tp2); + } return((tp2.tv_sec - tp1.tv_sec) + (tp2.tv_nsec - tp1.tv_nsec)*1.0e-9); } |