|
Security Scol plugin
|
Base class for timers. More...
#include <hrtimer.h>
Public Types | |
| enum | Unit { SECONDS = 0 , MILLISECONDS , MICROSECONDS , NANOSECONDS } |
| Unit of measure. More... | |
Public Member Functions | |
| TimerBase (Unit unit, bool stuckAtZero) | |
| Construct a TimerBase. | |
| virtual TimerWord | GetCurrentTimerValue ()=0 |
| Retrieve the current timer value. | |
| virtual TimerWord | TicksPerSecond ()=0 |
| Retrieve ticks per second. | |
| void | StartTimer () |
| Start the timer. | |
| double | ElapsedTimeAsDouble () |
| Retrieve the elapsed time. | |
| unsigned long | ElapsedTime () |
| Retrieve the elapsed time. | |
| enum TimerBase::Unit |
Unit of measure.
Unit selects the unit of measure as returned by functions ElapsedTimeAsDouble() and ElapsedTime().
| Enumerator | |
|---|---|
| SECONDS | Timer unit is seconds. All timers support seconds |
| MILLISECONDS | Timer unit is milliseconds. All timers support milliseconds |
| MICROSECONDS | Timer unit is microseconds. The timer requires hardware support microseconds |
| NANOSECONDS | Timer unit is nanoseconds. The timer requires hardware support nanoseconds |
|
inline |
| unsigned long TimerBase::ElapsedTime | ( | ) |
Retrieve the elapsed time.
The return value of ElapsedTime() depends upon the Unit selected during construction of the timer. For example, if Unit = SECONDS and ElapsedTime() returns 3, then the timer has run for 3 seconds. If Unit = MILLISECONDS and ElapsedTime() returns 3000, then the timer has run for 3 seconds.
Definition at line 83 of file hrtimer.cpp.
| double TimerBase::ElapsedTimeAsDouble | ( | ) |
Retrieve the elapsed time.
The return value of ElapsedTimeAsDouble() depends upon the Unit selected during construction of the timer. For example, if Unit = SECONDS and ElapsedTimeAsDouble() returns 3, then the timer has run for 3 seconds. If Unit = MILLISECONDS and ElapsedTimeAsDouble() returns 3000, then the timer has run for 3 seconds.
Definition at line 66 of file hrtimer.cpp.
|
pure virtual |
Retrieve the current timer value.
Implemented in ThreadUserTimer, and Timer.
| void TimerBase::StartTimer | ( | ) |
Start the timer.
Definition at line 60 of file hrtimer.cpp.
|
pure virtual |
Retrieve ticks per second.
TicksPerSecond() is not the timer resolution. It is a conversion factor into seconds.
Implemented in ThreadUserTimer, and Timer.