spot  1.99.4a
Public Member Functions | Protected Attributes | List of all members
spot::timer Class Reference

A timekeeper that accumulate interval of time. More...

#include <misc/timer.hh>

Collaboration diagram for spot::timer:
Collaboration graph

Public Member Functions

void start ()
 Start a time interval. More...
 
void stop ()
 Stop a time interval and update the sum of all intervals. More...
 
clock_t utime () const
 Return the user time of all accumulated interval. More...
 
clock_t stime () const
 Return the system time of all accumulated interval. More...
 
bool is_running () const
 Whether the timer is running. More...
 
std::chrono::milliseconds::rep walltime () const
 Return cumulative wall time. More...
 

Protected Attributes

time_info start_
 
time_info total_
 
bool running
 
std::chrono::high_resolution_clock::time_point wall_start_
 
std::chrono::milliseconds::rep wall_cumul_
 

Detailed Description

A timekeeper that accumulate interval of time.

Member Function Documentation

bool spot::timer::is_running ( ) const
inline

Whether the timer is running.

void spot::timer::start ( )
inline

Start a time interval.

clock_t spot::timer::stime ( ) const
inline

Return the system time of all accumulated interval.

Any time interval that has been start()ed but not stop()ed will not be accounted for.

void spot::timer::stop ( )
inline

Stop a time interval and update the sum of all intervals.

clock_t spot::timer::utime ( ) const
inline

Return the user time of all accumulated interval.

Any time interval that has been start()ed but not stop()ed will not be accounted for.

std::chrono::milliseconds::rep spot::timer::walltime ( ) const
inline

Return cumulative wall time.

In many cases the cpu time is not relevant and it's nice to have a walltime timer


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

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sun Oct 11 2015 10:50:09 for spot by doxygen 1.8.9.1