From: Vsevolod Stakhov Date: Fri, 27 Oct 2017 19:22:01 +0000 (+0100) Subject: [Minor] Another fix for ticks X-Git-Tag: 1.7.0~508 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e171447470d73962fcbcff2e5e0818a0362e30e;p=thirdparty%2Frspamd.git [Minor] Another fix for ticks --- diff --git a/src/libutil/util.c b/src/libutil/util.c index 9c2af41e3d..7840dc7449 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) {