Commit 84df7a36 authored by LEFEBVREJP email's avatar LEFEBVREJP email
Browse files

Merge branch 'time-duration' into 'master'

Fixed timer.wall_clock and timer.sum_wall_clock methods.

See merge request !117
parents dc007502 7f1ed1b2
Pipeline #159001 passed with stages
in 19 minutes and 14 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