From 6d49b688b3bd371c65353aa363725c432ff49da2 Mon Sep 17 00:00:00 2001 From: Sangjung Woo Date: Wed, 18 Jan 2017 16:53:59 +0900 Subject: [PATCH] timestamp: fix currentTime() problem amb::Timestamp::currentTime() should return the 'current' time and it is converted to the local time. However, currentTime() uses steady_clock instead of system_clock so it always returns the lower epoch value than the real one. This patch revises the value by adding startTimeEpoch. Change-Id: Ibe6e445e398642e663b130c6185eae989764f2a3 Signed-off-by: Sangjung Woo --- lib/timestamp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timestamp.cpp b/lib/timestamp.cpp index 9c25902..127f439 100644 --- a/lib/timestamp.cpp +++ b/lib/timestamp.cpp @@ -29,7 +29,7 @@ double amb::Timestamp::currentTime() double time = std::chrono::duration_cast(tm.time_since_epoch()).count() / 1000.00; - return time; + return time + startTimeEpoch; } double amb::Timestamp::epochTime(double time) -- 2.7.4