From fe9648fa1cdc8f9cf5216a88fadb8b96604047fd Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 3 Apr 2015 20:27:27 +0200 Subject: base/time: Replaces by std::chrono. --- src/base/timestamp.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/base/timestamp.cpp') diff --git a/src/base/timestamp.cpp b/src/base/timestamp.cpp index 1e86a8d4..c92ef99c 100644 --- a/src/base/timestamp.cpp +++ b/src/base/timestamp.cpp @@ -23,22 +23,21 @@ */ #include "timestamp.hpp" -#include "time.hpp" namespace usdx { Timestamp::Timestamp(void) - : time(Time::get_time()) + : time(std::chrono::steady_clock::now()) { } - bool Timestamp::since(float duration) const + bool Timestamp::since(std::chrono::milliseconds duration) const { - return Time::get_time() < (time + duration); + return std::chrono::steady_clock::now() < (time + duration); } void Timestamp::update(void) { - time = Time::get_time(); + time = std::chrono::steady_clock::now(); } } -- cgit v1.2.3