Isle
Loading...
Searching...
No Matches
MxFrequencyMeter Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ MxFrequencyMeter()

MxFrequencyMeter::MxFrequencyMeter ( )

Constructs a new MxFrequencyMeter with zeroed counters.

[AI]

Member Function Documentation

◆ ElapsedSeconds()

double MxFrequencyMeter::ElapsedSeconds ( ) const

Returns the total elapsed seconds since the last Reset().

[AI]

◆ EndOperation()

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.

◆ Frequency()

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.

◆ IncreaseOperationCount()

void MxFrequencyMeter::IncreaseOperationCount ( unsigned long  delta)

Increases the operation count by the specified delta.

[AI]

Parameters
deltaAmount to increase the operation count by. [AI]

◆ OperationCount()

unsigned long MxFrequencyMeter::OperationCount ( ) const

Returns the total number of completed operations.

[AI]

◆ Reset()

void MxFrequencyMeter::Reset ( )

Resets the operation counter and stopwatch to zero.

[AI]

◆ StartOperation()

void MxFrequencyMeter::StartOperation ( )

Marks the beginning of a measured operation.

[AI]

[AI] Internally starts its stopwatch.


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