LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
Public Member Functions | List of all members
loos::Timer< TimerType > Class Template Reference

Class for tracking time. More...

#include <loos_timer.hpp>

Inheritance diagram for loos::Timer< TimerType >:
Inheritance graph
[legend]
Collaboration diagram for loos::Timer< TimerType >:
Collaboration graph
[legend]

Public Member Functions

void start (void)
 Starts the timer.
 
double stop (void)
 Stops the timer.
 
double elapsed (void) const
 Return the elapsed time.
 
double lap (void)
 Returns the current lap time.
 
double averageLapTime (void)
 Return the current average lap-time...
 
- Public Member Functions inherited from loos::WallTimer
double currentTime (void) const
 

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...

Member Function Documentation

◆ elapsed()

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.

◆ lap()

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.


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