Commit 7f1ed1b2 authored by LEFEBVREJP email's avatar LEFEBVREJP email
Browse files

Fixed timer.wall_clock and timer.sum_wall_clock methods.

parent dc007502
Pipeline #158998 passed with stages
in 17 minutes and 51 seconds
......@@ -247,9 +247,10 @@ class Timer
double wall_clock()
{
radix_require(!mRunning);
auto nanoseconds =
std::chrono::duration_cast<std::chrono::nanoseconds>(mEnd - mStart);
// 1e9 nanoseconds in a second
using seconds = std::chrono::duration<double, std::ratio<1000, 1>>;
return seconds(mEnd - mStart).count();
return nanoseconds.count() / 1e9;
}
/**
......@@ -261,8 +262,7 @@ class Timer
double sum_wall_clock()
{
// 1e9 nanoseconds in a second
using seconds = std::chrono::duration<double, std::ratio<1000, 1>>;
return seconds(mDuration).count();
return mDuration.count() / 1e9;
}
/**
......
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