]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Another fix for ticks
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Oct 2017 19:22:01 +0000 (20:22 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Oct 2017 19:38:08 +0000 (20:38 +0100)
src/libutil/util.c

index 9c2af41e3df4f34b632379ec00d1ed5cffa1cf67..7840dc7449519651281a2ac01e98ff4fa9cabd66 100644 (file)
@@ -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) {