diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-02-05 09:35:23 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-02-05 09:35:23 +0000 |
commit | 9813f9cb0bcd7dfa039c33aa0f3b4b600d6fd8a9 (patch) | |
tree | e0301af92c1c208200d886abbc03f59ec1f1172b /storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp | |
parent | 11b731d1a6b3a9e9bbf84bc94285a6c22d6910e1 (diff) |
Øess use of getSeconds/getMicroSeconds/getMilliSeconds.
Diffstat (limited to 'storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp')
-rw-r--r-- | storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp b/storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp index 0303481feb5..df6115aa416 100644 --- a/storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp +++ b/storage/src/vespa/storageframework/defaultimplementation/clock/realclock.cpp @@ -5,27 +5,36 @@ namespace storage::framework::defaultimplementation { -MicroSecTime RealClock::getTimeInMicros() const { +MicroSecTime +RealClock::getTimeInMicros() const { struct timeval mytime; gettimeofday(&mytime, 0); return MicroSecTime(mytime.tv_sec * 1000000llu + mytime.tv_usec); } -MilliSecTime RealClock::getTimeInMillis() const { +MilliSecTime +RealClock::getTimeInMillis() const { struct timeval mytime; gettimeofday(&mytime, 0); return MilliSecTime( mytime.tv_sec * 1000llu + mytime.tv_usec / 1000); } -SecondTime RealClock::getTimeInSeconds() const { +SecondTime +RealClock::getTimeInSeconds() const { struct timeval mytime; gettimeofday(&mytime, 0); return SecondTime(mytime.tv_sec); } -MonotonicTimePoint RealClock::getMonotonicTime() const { - return std::chrono::steady_clock::now(); +vespalib::steady_time +RealClock::getMonotonicTime() const { + return vespalib::steady_clock::now(); +} + +vespalib::system_time +RealClock::getSystemTime() const { + return vespalib::system_clock::now(); } } |