Commit 2c2ac653 authored by LEFEBVREJP email's avatar LEFEBVREJP email
Browse files

Updating timer to use steady_clock instead of system_clock to avoid system clock change.

parent ea0d60b5
Pipeline #7417 passed with stages
in 27 minutes and 26 seconds
......@@ -124,8 +124,8 @@ class Timer
{
private:
bool mRunning;
std::chrono::system_clock::time_point mStart;
std::chrono::system_clock::time_point mEnd;
std::chrono::steady_clock::time_point mStart;
std::chrono::steady_clock::time_point mEnd;
std::chrono::nanoseconds mDuration;
size_t mIntervals;
public:
......@@ -139,12 +139,12 @@ public:
radix_check(!mRunning);
mRunning = true;
mIntervals++;
mStart = std::chrono::system_clock::now();
mStart = std::chrono::steady_clock::now();
}
void stop()
{
radix_check(mRunning);
mEnd = std::chrono::system_clock::now();
mEnd = std::chrono::steady_clock::now();
mRunning = false;
mDuration += std::chrono::duration_cast<std::chrono::nanoseconds>(mEnd-mStart);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment