PSCF v1.1
|
Wall clock timer. More...
#include <Timer.h>
Public Member Functions | |
Timer () | |
Default constructor. More... | |
void | start (TimePoint begin) |
Start timing from an externally supplied time. More... | |
void | start () |
Start timing from now (internally computed). More... | |
void | stop (TimePoint end) |
Stop the clock at an externally supplied time. More... | |
void | stop () |
Stop the clock now (internally supplied). More... | |
bool | isRunning () |
Is this Timer running? More... | |
void | clear () |
Reset accumulated time to zero. More... | |
double | time () |
Return the accumulated time, in seconds. More... | |
Static Public Member Functions | |
static TimePoint | now () |
Return current time point. More... | |
Wall clock timer.
A Timer keeps track of the time elapsed during one or more interval. Each interval begins when start() is called and ends when stop() is called. If start() and stop() are invoked repeatedly, the timer accumulates the time elapses in multiple intervals. The accumulated time is returned by the time() method, and can be reset to zero by the clear() method.
Util::Timer::Timer | ( | ) |
void Util::Timer::start | ( | TimePoint | begin | ) |
Start timing from an externally supplied time.
Set start time and set isRunning = true.
begin | starting TimePoint. |
Definition at line 49 of file Timer.cpp.
References UTIL_THROW.
Referenced by Pscf::Fd1d::BinaryRelaxIterator::solve().
void Util::Timer::start | ( | ) |
Start timing from now (internally computed).
Set start time and set isRunning = true.
Definition at line 61 of file Timer.cpp.
References now(), and UTIL_THROW.
void Util::Timer::stop | ( | TimePoint | end | ) |
Stop the clock at an externally supplied time.
Increment accumulated time, set isRunning = false.
Definition at line 73 of file Timer.cpp.
References UTIL_THROW.
Referenced by Pscf::Fd1d::BinaryRelaxIterator::solve().
|
inline |
|
inline |
void Util::Timer::clear | ( | ) |
double Util::Timer::time | ( | ) |
Return the accumulated time, in seconds.
Definition at line 37 of file Timer.cpp.
Referenced by Pscf::Fd1d::BinaryRelaxIterator::solve().
|
static |