LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::AccumulatingTimer Class Reference

Timer that accumulates mean and variance of timer durations as it goes. More...

#include <accumulating_timer.hpp>

Collaboration diagram for lbann::AccumulatingTimer:
[legend]

Public Member Functions

Timing interface
void start () noexcept
 Start counting time for this duration sample. More...
 
double stop () noexcept
 Get the elapsed time for this duration in seconds. More...
 
double check () const noexcept
 Get the current elapsed time in this duration (in seconds) without stopping the timer. More...
 
void reset () noexcept
 Reset this duration without caching it in the running statistics. More...
 
bool running () const noexcept
 Determine whether there is an active duration sample running. More...
 
Statistics
size_t samples () const noexcept
 The number of durations observed in this timer. More...
 
double mean () const noexcept
 The mean observed duration. More...
 
double stddev () const noexcept
 The standard deviation of observed durations. More...
 
double min () const noexcept
 The smallest observed duration. More...
 
double max () const noexcept
 The largest observed duration. More...
 
double total_time () const noexcept
 The total time observed by this timer. More...
 
void reset_statistics () noexcept
 Clear the running history of durations. More...
 

Private Attributes

Timer m_timer
 
RunningStats m_stats
 

Detailed Description

Timer that accumulates mean and variance of timer durations as it goes.

Definition at line 41 of file accumulating_timer.hpp.

Member Function Documentation

◆ check()

double lbann::AccumulatingTimer::check ( ) const
inlinenoexcept

Get the current elapsed time in this duration (in seconds) without stopping the timer.

Definition at line 125 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ max()

double lbann::AccumulatingTimer::max ( ) const
inlinenoexcept

The largest observed duration.

Definition at line 157 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ mean()

double lbann::AccumulatingTimer::mean ( ) const
inlinenoexcept

The mean observed duration.

Definition at line 142 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ min()

double lbann::AccumulatingTimer::min ( ) const
inlinenoexcept

The smallest observed duration.

Definition at line 152 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ reset()

void lbann::AccumulatingTimer::reset ( )
inlinenoexcept

Reset this duration without caching it in the running statistics.

Definition at line 130 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ reset_statistics()

void lbann::AccumulatingTimer::reset_statistics ( )
inlinenoexcept

Clear the running history of durations.

Definition at line 167 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ running()

bool lbann::AccumulatingTimer::running ( ) const
inlinenoexcept

Determine whether there is an active duration sample running.

Definition at line 132 of file accumulating_timer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ samples()

size_t lbann::AccumulatingTimer::samples ( ) const
inlinenoexcept

The number of durations observed in this timer.

Definition at line 137 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ start()

void lbann::AccumulatingTimer::start ( )
inlinenoexcept

Start counting time for this duration sample.

If the clock is already running, this will restart the counter.

Definition at line 113 of file accumulating_timer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stddev()

double lbann::AccumulatingTimer::stddev ( ) const
inlinenoexcept

The standard deviation of observed durations.

Definition at line 147 of file accumulating_timer.hpp.

Here is the call graph for this function:

◆ stop()

double lbann::AccumulatingTimer::stop ( )
inlinenoexcept

Get the elapsed time for this duration in seconds.

Resets the counter, so a subsequent call to stop() or check() without another start() will return 0.0.

The time will be committed to the running statistics accumulation only if the timer is in the "running" state when this is called.

Definition at line 115 of file accumulating_timer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ total_time()

double lbann::AccumulatingTimer::total_time ( ) const
inlinenoexcept

The total time observed by this timer.

Only time that has been committed is reported. That is, it does NOT include any time from the current sample if the timer is currently running.

Definition at line 162 of file accumulating_timer.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_stats

RunningStats lbann::AccumulatingTimer::m_stats
private

Definition at line 110 of file accumulating_timer.hpp.

◆ m_timer

Timer lbann::AccumulatingTimer::m_timer
private

Definition at line 109 of file accumulating_timer.hpp.


The documentation for this class was generated from the following file: