AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agx::HighAccuracyTimer Class Reference

The HighAccurayTimer class can replace the regular Timer class in high level applications where the need for accuracy is greater than performance. More...

#include <HighAccuracyTimer.h>

Public Member Functions

 HighAccuracyTimer (bool startImmediately=false)
 Creates a HighAccuracyTimer.
 
Real64 getTime () const
 Report total elapsed time since start in milliseconds, excluding intervals when the timer was suspended.
 
bool isRunning () const
 Return true if running.
 
void reset (bool startAfterReset=false)
 Clear all data and optionally restart the timer.
 
void start ()
 Starts the HighAccuracyTimer.
 
void stop ()
 Stops the HighAccuracyTimer.
 

Detailed Description

The HighAccurayTimer class can replace the regular Timer class in high level applications where the need for accuracy is greater than performance.

This timer is based upon std::chrono::high_resolution_clock. This timer should primarily be used with low calling frequency, such as when measuring total computation time.

Definition at line 37 of file HighAccuracyTimer.h.

Constructor & Destructor Documentation

◆ HighAccuracyTimer()

agx::HighAccuracyTimer::HighAccuracyTimer ( bool  startImmediately = false)
inline

Creates a HighAccuracyTimer.

Parameters
startImmediatelyShould the HighAccuracyTimer start immediately or start in stopped mode

Definition at line 86 of file HighAccuracyTimer.h.

References reset(), and start().

Member Function Documentation

◆ getTime()

Real64 agx::HighAccuracyTimer::getTime ( ) const

Report total elapsed time since start in milliseconds, excluding intervals when the timer was suspended.

Definition at line 133 of file HighAccuracyTimer.h.

◆ isRunning()

bool agx::HighAccuracyTimer::isRunning ( ) const

Return true if running.

Definition at line 127 of file HighAccuracyTimer.h.

◆ reset()

void agx::HighAccuracyTimer::reset ( bool  startAfterReset = false)

Clear all data and optionally restart the timer.

Definition at line 117 of file HighAccuracyTimer.h.

References start().

Referenced by HighAccuracyTimer().

◆ start()

void agx::HighAccuracyTimer::start ( )

Starts the HighAccuracyTimer.

Calling start on a already started HighAccuracyTimer will have no effect.

Definition at line 94 of file HighAccuracyTimer.h.

Referenced by HighAccuracyTimer(), and reset().

◆ stop()

void agx::HighAccuracyTimer::stop ( )

Stops the HighAccuracyTimer.

Calling stop on a already stopped HighAccuracyTimer will have no effect. Upon stopping, the amount of cycles and time ran will be updated.

Definition at line 105 of file HighAccuracyTimer.h.

References agx::end().


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