timestamp: fix currentTime() problem 40/110840/1 accepted/tizen/3.0/ivi/20170119.020919 submit/tizen_3.0/20170118.080931
authorSangjung Woo <sangjung.woo@samsung.com>
Wed, 18 Jan 2017 07:53:59 +0000 (16:53 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Wed, 18 Jan 2017 07:53:59 +0000 (16:53 +0900)
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 <sangjung.woo@samsung.com>
lib/timestamp.cpp

index 9c25902..127f439 100644 (file)
@@ -29,7 +29,7 @@ double amb::Timestamp::currentTime()
 
        double time = std::chrono::duration_cast<std::chrono::milliseconds>(tm.time_since_epoch()).count() / 1000.00;
 
-       return time;
+       return time + startTimeEpoch;
 }
 
 double amb::Timestamp::epochTime(double time)