Isle
|
Utility for measuring the frequency (operations per second) of a repeated operation. More...
#include <mxstopwatch.h>
Public Member Functions | |
MxFrequencyMeter () | |
Constructs a new MxFrequencyMeter with zeroed counters. More... | |
void | StartOperation () |
Marks the beginning of a measured operation. More... | |
void | EndOperation () |
Marks the end of a measured operation and increments the count. More... | |
double | Frequency () const |
Returns the measured frequency (operations per elapsed second). More... | |
void | Reset () |
Resets the operation counter and stopwatch to zero. More... | |
unsigned long | OperationCount () const |
Returns the total number of completed operations. More... | |
double | ElapsedSeconds () const |
Returns the total elapsed seconds since the last Reset(). More... | |
void | IncreaseOperationCount (unsigned long delta) |
Increases the operation count by the specified delta. More... | |
Utility for measuring the frequency (operations per second) of a repeated operation.
[AI]
[AI] Wraps a MxStopWatch and an operation counter to determine how often something occurs per unit time—very useful for profiling, frame/tick rate monitoring, or rate-limited subsystems.
Definition at line 91 of file mxstopwatch.h.
MxFrequencyMeter::MxFrequencyMeter | ( | ) |
Constructs a new MxFrequencyMeter with zeroed counters.
[AI]
double MxFrequencyMeter::ElapsedSeconds | ( | ) | const |
Returns the total elapsed seconds since the last Reset().
[AI]
void MxFrequencyMeter::EndOperation | ( | ) |
Marks the end of a measured operation and increments the count.
[AI]
[AI] Stops the stopwatch to accumulate elapsed time for this operation and increments the operation count.
double MxFrequencyMeter::Frequency | ( | ) | const |
Returns the measured frequency (operations per elapsed second).
[AI]
[AI] Returns HUGE_VAL if at least one operation occurred but elapsed time is zero; returns 0 if no operations.
void MxFrequencyMeter::IncreaseOperationCount | ( | unsigned long | delta | ) |
Increases the operation count by the specified delta.
[AI]
delta | Amount to increase the operation count by. [AI] |
unsigned long MxFrequencyMeter::OperationCount | ( | ) | const |
Returns the total number of completed operations.
[AI]
void MxFrequencyMeter::Reset | ( | ) |
Resets the operation counter and stopwatch to zero.
[AI]
void MxFrequencyMeter::StartOperation | ( | ) |
Marks the beginning of a measured operation.
[AI]
[AI] Internally starts its stopwatch.