diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-27 20:22:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-27 20:38:08 +0100 |
commit | 8e171447470d73962fcbcff2e5e0818a0362e30e (patch) | |
tree | 7ff735e1362592d88350390c624779d71bb3042a /src | |
parent | 5b12e0142a38c8974e4125232bb19454eae214e4 (diff) | |
download | rspamd-8e171447470d73962fcbcff2e5e0818a0362e30e.tar.gz rspamd-8e171447470d73962fcbcff2e5e0818a0362e30e.zip |
[Minor] Another fix for ticks
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/util.c | 10 |
1 files 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) { |