From 4e51439118fb2043226460818a840591f167f813 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 18 Aug 2020 15:19:09 +0300 Subject: [PATCH] bsd compat --- src/tools.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools.h b/src/tools.h index a41c879..d604e86 100644 --- a/src/tools.h +++ b/src/tools.h @@ -78,7 +78,13 @@ INLINE long double get_now_monotonic(void) { time_t sec; long msec; +# if defined(CLOCK_MONOTONIC_RAW) get_now(CLOCK_MONOTONIC_RAW, &sec, &msec); +# elif defined(CLOCK_MONOTONIC_FAST) + get_now(CLOCK_MONOTONIC_FAST, &sec, &msec); +# else + get_now(CLOCK_MONOTONIC, &sec, &msec); +# endif return (long double)sec + ((long double)msec) / 1000; }