|
AGX Dynamics
2.37.2.0
|
The Timer class permits timing execution speed with the same refinement as the built in hardware clock of the CPU. More...
#include <Timer.h>
Public Member Functions | |
| Timer (bool startImmediately=false) | |
| Creates a timer. More... | |
| UInt64 | getNumTicks () const |
| Report execution time in CPU cycles. More... | |
| UInt64 | getStartTick () const |
| Real64 | getTime () const |
| Report total elapsed time since start in milliseconds, excluding intervals when the timer was suspended. More... | |
| bool | isRunning () const |
| void | reset (bool startAfterReset=false) |
| Clear all data. More... | |
| void | start () |
| Starts the timer. More... | |
| void | stop () |
| Stops the timer. More... | |
Static Public Member Functions | |
| static Real64 | convertToMs (UInt64 ticks) |
| static UInt64 | getCurrentTick () |
| static Real64 | getTime (UInt64 startTick) |
| static void | initClockSpeed () |
| For internal use only. More... | |
The Timer class permits timing execution speed with the same refinement as the built in hardware clock of the CPU.
Profiling tools typically have sampling rates which are too coarse for detailed timing analysis. The Timer class uses the hardware clock to record beginning and end times of given code sections.
A Timer with better accuracy, but lower performance ( that uses QueryPerformanceFrequency/QueryPerformanceTimer in Windows), can be found in HighAccuracyTimer. Use this for high level application where performance is not as important.
(For Windows, QueryPerformanceFrequency/QueryPerformanceTimer is used if AGX_USE_HPET is set).
|
inline |
Definition at line 312 of file Timer.h.
Referenced by agxUtil::TimerBlock::create(), and getTime().
|
static |
Definition at line 256 of file Timer.h.
References agxAbort1.
Referenced by getTime(), and agxUtil::TimerBlock::stop().
| UInt64 agx::Timer::getNumTicks | ( | ) | const |
| UInt64 agx::Timer::getStartTick | ( | ) | const |
| Real64 agx::Timer::getTime | ( | ) | const |
Report total elapsed time since start in milliseconds, excluding intervals when the timer was suspended.
Definition at line 225 of file Timer.h.
References AGX_FORCE_INLINE, and agxAssert1.
Referenced by agx::Job::getExecutionTime().
Definition at line 307 of file Timer.h.
References convertToMs(), and getCurrentTick().
|
static |
For internal use only.
| bool agx::Timer::isRunning | ( | ) | const |
| void agx::Timer::reset | ( | bool | startAfterReset = false | ) |
| void agx::Timer::start | ( | ) |
| void agx::Timer::stop | ( | ) |