From 8e171447470d73962fcbcff2e5e0818a0362e30e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 27 Oct 2017 20:22:01 +0100 Subject: [PATCH] [Minor] Another fix for ticks --- src/libutil/util.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/libutil/util.c b/src/libutil/util.c index 9c2af41e3..7840dc744 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -1787,19 +1787,13 @@ rspamd_get_ticks (gboolean rdtsc_ok) struct timespec ts; gint clk_id = CLOCK_MONOTONIC; -# ifdef CLOCK_MONOTONIC_FAST - clk_id = CLOCK_MONOTONIC_FAST; -# endif -# ifdef CLOCK_MONOTONIC_COARSE - clk_id = CLOCK_MONOTONIC_COARSE; -# endif clock_gettime (clk_id, &ts); if (rdtsc_ok) { - res = (double) ts.tv_sec + ts.tv_nsec / 1000000000.; + res = (double) ts.tv_sec * 1e9 + ts.tv_nsec; } else { - res = (double) ts.tv_sec * 1e9 + ts.tv_nsec; + res = (double) ts.tv_sec + ts.tv_nsec / 1000000000.; } # elif defined(__APPLE__) if (rdtsc_ok) { -- 2.39.5