|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
An exceedingly simple duration calculator. More...
#include <timer.hpp>
Public Types | |
| using | ClockType = std::chrono::steady_clock |
| The clock used for counting. More... | |
| using | TimePoint = typename ClockType::time_point |
| Simplifying typedef. More... | |
Public Member Functions | |
| Timer ()=default | |
| ~Timer () noexcept=default | |
| Timer (Timer const &)=delete | |
| Timer & | operator= (Timer const &)=delete |
| Timer (Timer &&)=default | |
| Timer & | operator= (Timer &&)=default |
| void | start () noexcept |
| Start counting time. More... | |
| double | stop () noexcept |
| Get the total elapsed time in seconds. More... | |
| double | check () const noexcept |
| Get the current elapsed time (seconds) without stopping. More... | |
| void | reset () noexcept |
| Clear any internal state in the timer. More... | |
| bool | running () const noexcept |
| Check if the timer is running. More... | |
Private Attributes | |
| TimePoint | m_start |
An exceedingly simple duration calculator.
This clock does not have a notion of "pause and restart". Calling check() will not stop the counter; calling stop() will clear the counter. Calling start() on a running timer will reset the clock to zero.
Definition at line 52 of file utils/timer.hpp.
| using lbann::Timer::ClockType = std::chrono::steady_clock |
The clock used for counting.
Per guidance from cppreference, this should be the steady clock for measuring durations. The high-res clock can be unstable. (Source)
Definition at line 61 of file utils/timer.hpp.
| using lbann::Timer::TimePoint = typename ClockType::time_point |
Simplifying typedef.
Definition at line 63 of file utils/timer.hpp.
|
default |
|
defaultnoexcept |
|
delete |
|
default |
|
inlinenoexcept |
Get the current elapsed time (seconds) without stopping.
Definition at line 97 of file utils/timer.hpp.
|
inlinenoexcept |
Clear any internal state in the timer.
Definition at line 106 of file utils/timer.hpp.
|
inlinenoexcept |
Check if the timer is running.
Definition at line 109 of file utils/timer.hpp.
|
inlinenoexcept |
Start counting time.
If the clock is already running, this will restart the counter.
Definition at line 80 of file utils/timer.hpp.
|
inlinenoexcept |
|
private |
Definition at line 112 of file utils/timer.hpp.