LOOS  v2.3.2
loos::Timer< TimerType > Class Template Reference

Class for tracking time. More...

#include <timer.hpp>

Inheritance diagram for loos::Timer< TimerType >:
Collaboration diagram for loos::Timer< TimerType >:

Public Member Functions

void start (void)
 Starts the timer.
 
double stop (void)
 Stops the timer.
 
double elapsed (void) const
 Return the elapsed time. More...
 
double lap (void)
 Returns the current lap time. More...
 
double averageLapTime (void)
 Return the current average lap-time...
 

Detailed Description

template<class TimerType = WallTimer>
class loos::Timer< TimerType >

Class for tracking time.

Can either track wall-time or user-time, depending on the timer policy class used... The default is to track wall-time. Starting and stopping the timer does not actually do anything other than adjust how the current time is tracked, i.e. no real timers (interrupts, etc) are created.

Time is tracked to microsecond precision... See gettimeofday(2) or getrusage(2) for more information...

Definition at line 80 of file timer.hpp.

Member Function Documentation

template<class TimerType = WallTimer>
double loos::Timer< TimerType >::elapsed ( void  ) const
inline

Return the elapsed time.

If the timer is running, it returns the difference between current time and when the timer was started. If the timer is stopped, then it returns the length of time the timer was active.

Definition at line 109 of file timer.hpp.

template<class TimerType = WallTimer>
double loos::Timer< TimerType >::lap ( void  )
inline

Returns the current lap time.

Lap time is a mechanism for tracking interval times. Each time lap() is called, it tracks not only the current lap-time but the average time for each lap. When the timer is stopped, a lap is automatically added.

Definition at line 118 of file timer.hpp.


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