diff options
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(); } } |