53 return std::chrono::duration_cast<std::chrono::hours>(diff).count() / (24);
63 return std::chrono::duration_cast<std::chrono::nanoseconds>(diff).count() * 1e-9;
73 std::ostringstream te;
74 te << std::fixed << std::setprecision(3);
80 real remainder_seconds = seconds - days * 24 * 3600;
83 te <<
" 1 day and " << remainder_seconds <<
" seconds";
87 te << days <<
" days and " << remainder_seconds <<
" seconds";
92 te << seconds <<
" seconds";
98 std::chrono::high_resolution_clock clock_;
100 std::chrono::high_resolution_clock::time_point start, end;
101 std::chrono::high_resolution_clock::duration diff;
Timer class which keeps accurate wall time.
Definition: wxtimer.h:22
void startTimer()
Start the timer.
Definition: wxtimer.h:32
void stopTimer()
Stops the timer.
Definition: wxtimer.h:40
WxTimer()=default
Constructor.
std::string timeElapsedAsString() const
Return time elapsed as a string.
Definition: wxtimer.h:71
unsigned daysElapsed() const
Return number of days elapsed.
Definition: wxtimer.h:51
real secondsElapsed() const
Return number of seconds elapsed.
Definition: wxtimer.h:61
#define real
Definition: wmoclunstructuredreconstruction.h:11