Menge
Modular Pedestrian Simulation Framework for Research and Development
|
A timer which uses a cache of values to only update its values every N calls to lap/elapsed. Useful for displaying frame rate. More...
#include <Profiler.h>
Public Member Functions | |
SampleTimer (int sampleCount) | |
Constructor. More... | |
float | lap (float scale=1.f) |
Reports the average elapsed time of the last N calls to lap. More... | |
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 | |
int | _totalSamples |
The number of samples to compute the average over. | |
int | _currSample |
The curren total number of calls to lap. | |
float | _total |
The current accrual of time for the current cache (in seconds). | |
float | _cached |
The most recently defined elapsed lap time. | |
Protected Attributes inherited from Menge::Vis::Timer | |
struct timespec | _start |
The time (in clock cycles) at which the timer was started. | |
A timer which uses a cache of values to only update its values every N calls to lap/elapsed. Useful for displaying frame rate.
Menge::Vis::SampleTimer::SampleTimer | ( | int | sampleCount | ) |
Constructor.
sampleCount | The number of repeated calls to lap to cause the timer to report a new, average value. |
float Menge::Vis::SampleTimer::lap | ( | float | scale = 1.f | ) |
Reports the average elapsed time of the last N calls to lap.
scale | The scale of the units to report the elapsed time in. e.g., 1.0 –> seconds, 0.001 –>, 1e-6 –> microseconds. |