From efd35b9f3dcb9b08e991d56a686d41088e15841c Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Fri, 5 Feb 2016 01:03:23 +0600 Subject: [PATCH] time-util: use dual_timestamp_get() The time-util.c provides dual_timestamp_get() function for getting realtime and monotonic timestamps. Let's use it instead of direct realtime/monotonic calculation. --- src/basic/time-util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 34061fea9..28b20f418 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -112,9 +112,8 @@ dual_timestamp* dual_timestamp_from_boottime_or_monotonic(dual_timestamp *ts, us ts->realtime = ts->monotonic = USEC_INFINITY; return ts; } - ts->realtime = now(CLOCK_REALTIME); - ts->monotonic = now(CLOCK_MONOTONIC); + dual_timestamp_get(ts); delta = (int64_t) now(clock_boottime_or_monotonic()) - (int64_t) u; if ((int64_t) ts->realtime > delta) -- 2.30.2