Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::Vis::LapTimer Class Reference

Lap timer. A timer which supports "laps" i.e., single calls which measure from the last "tick" to this tick. More...

#include <Profiler.h>

Inheritance diagram for Menge::Vis::LapTimer:
Menge::Vis::Timer

Public Member Functions

 LapTimer ()
 Default constructor.
 
float lap (float scale=1.f)
 Reports the time elapsed from the previous call to lap() or start() to this call. The clock is still "running" and the next lap starts. More...
 
float average (float scale=1.f)
 Reports the average lap time across all recorded laps. More...
 
int laps () const
 Reports the number of calls to laps.
 
- Public Member Functions inherited from Menge::Vis::Timer
 Timer ()
 Default constructor.
 
void start ()
 Starts the timer running.
 
float elapsed (float scale)
 Reports the time elapsed between this call and the last start. More...
 

Protected Attributes

double _total
 The total accrued time of timed intervals (in seconds).
 
int _lapCount
 The total number of calls to lap()
 
- Protected Attributes inherited from Menge::Vis::Timer
struct timespec _start
 The time (in clock cycles) at which the timer was started.
 

Detailed Description

Lap timer. A timer which supports "laps" i.e., single calls which measure from the last "tick" to this tick.

Member Function Documentation

float Menge::Vis::LapTimer::average ( float  scale = 1.f)

Reports the average lap time across all recorded laps.

Parameters
scaleThe scale of the units to report the elapsed time in. e.g., 1.0 –> seconds, 0.001 –>, 1e-6 –> microseconds.
Returns
The time elapsed (for units see "scale").
float Menge::Vis::LapTimer::lap ( float  scale = 1.f)

Reports the time elapsed from the previous call to lap() or start() to this call. The clock is still "running" and the next lap starts.

Parameters
scaleThe scale of the units to report the elapsed time in. e.g., 1.0 –> seconds, 0.001 –>, 1e-6 –> microseconds.
Returns
The time elapsed (for units see "scale").

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