diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-15 10:53:09 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-15 10:53:09 +0000 |
commit | 363603705abd5d0204531f1ac8e5eb84338c120f (patch) | |
tree | 46f2aafb36a81107ad6878a7e5661dac87b91eee /staging_vespalib/src | |
parent | 5b2071b9f54c54cbc79225b27faf8ac645158e72 (diff) |
Use ClockSteady and return TimeStamp instead of untyped int64_t without unit.
Diffstat (limited to 'staging_vespalib/src')
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/util/clock.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/clock.cpp b/staging_vespalib/src/vespa/vespalib/util/clock.cpp index 10d075a21bd..543a475480b 100644 --- a/staging_vespalib/src/vespa/vespalib/util/clock.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/clock.cpp @@ -4,9 +4,6 @@ #include <cassert> #include <chrono> -using namespace fastos; -using namespace std::chrono; - namespace vespalib { @@ -28,7 +25,7 @@ Clock::~Clock() void Clock::setTime() const { - _timeNS = duration_cast<nanoseconds>(steady_clock::now().time_since_epoch()).count(); + _timeNS = fastos::ClockSteady::now(); } void Clock::Run(FastOS_ThreadInterface *thread, void *arguments) @@ -38,7 +35,7 @@ void Clock::Run(FastOS_ThreadInterface *thread, void *arguments) std::unique_lock<std::mutex> guard(_lock); while ( ! thread->GetBreakFlag() && !_stop) { setTime(); - _cond.wait_for(guard, milliseconds(_timePeriodMS)); + _cond.wait_for(guard, std::chrono::milliseconds(_timePeriodMS)); } _running = false; } |