|
Allows for timing the algorithms; accurate up to 0.01 sec. More...
#include <MercuryTime.h>
Public Member Functions | |
Time () | |
void | tic () |
This is like a start button of a stopwatch. Assigns the variable start with the current number of clock ticks. More... | |
Mdouble | toc () |
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks returned by clock(). More... | |
Mdouble | getCPUTime () const |
Mdouble | getWallTime () |
Mdouble | toctic () |
Outputs the toc value and resets the start time. More... | |
Private Attributes | |
clock_t | start |
Stores the number of clock ticks, called by Time::tic(). More... | |
std::chrono::time_point< std::chrono::high_resolution_clock > | wallClockStart |
clock_t | finish |
Stores the number of clock ticks, called by Time::toc(). More... | |
std::chrono::time_point< std::chrono::high_resolution_clock > | wallClockFinish |
Allows for timing the algorithms; accurate up to 0.01 sec.
Calculates the amount of computational time used, in seconds. Works on the same concept of stopwatch, where one presses start and stops when needed. The difference returns the total time used up. Usage: Time time; ...; std::cout << time.toc();
|
inline |
|
inline |
|
inline |
Returns the time elapsed (in seconds) between tic and toc.
References wallClockFinish, and wallClockStart.
Referenced by DPMBase::getWallTime(), and toc().
|
inline |
This is like a start button of a stopwatch. Assigns the variable start with the current number of clock ticks.
References start, and wallClockStart.
Referenced by main(), DPMBase::solve(), and Time().
|
inline |
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks returned by clock().
References finish, getWallTime(), and wallClockFinish.
Referenced by main(), DPMBase::solve(), and toctic().
|
inline |
|
private |
Stores the number of clock ticks, called by Time::toc().
Referenced by getCPUTime(), Time(), toc(), and toctic().
|
private |
Stores the number of clock ticks, called by Time::tic().
Referenced by getCPUTime(), tic(), Time(), and toctic().
|
private |
Referenced by getWallTime(), and toc().
|
private |
Referenced by getWallTime(), and tic().