spot  1.0.1
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

 timer ()
void start ()
 Start a time interval.
void stop ()
 Stop a time interval and update the sum of all intervals.
clock_t utime () const
 Return the user time of all accumulated interval.
clock_t stime () const
 Return the system time of all accumulated interval.
bool is_running () const
 Whether the timer is running.

Protected Attributes

time_info start_
time_info total_
bool running

Detailed Description

A timekeeper that accumulate interval of time.

Constructor & Destructor Documentation

spot::timer::timer ( )
inline

Member Function Documentation

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

Whether the timer is running.

References running.

void spot::timer::start ( )
inline

Start a time interval.

References running, start_, spot::time_info::stime, and spot::time_info::utime.

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.

References spot::time_info::stime, and total_.

void spot::timer::stop ( )
inline

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

References running, start_, spot::time_info::stime, total_, and spot::time_info::utime.

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.

References total_, and spot::time_info::utime.

Member Data Documentation

bool spot::timer::running
protected

Referenced by is_running(), start(), and stop().

time_info spot::timer::start_
protected

Referenced by start(), and stop().

time_info spot::timer::total_
protected

Referenced by stime(), stop(), and utime().


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

Please comment this page and report errors about it on the RefDocComments page.
Generated on Wed Jan 23 2013 15:00:02 for spot by doxygen 1.8.1.2