This class implements a high performance timer.
More...
|
| HighPerformanceTimer () |
| Creates a new timer and starts the time measurement. More...
|
|
void | start () |
| (Re-)starts the time measurement. More...
|
|
double | seconds () const |
| Returns the measured time since the timer has been started in seconds. More...
|
|
double | mseconds () const |
| Returns the measured time since the timer has been started in milliseconds. More...
|
|
double | yseconds () const |
| Returns the measured time since the timer has been started in microseconds. More...
|
|
double | nseconds () const |
| Returns the measured time since the timer has been started in nanoseconds. More...
|
|
This class implements a high performance timer.
Use this timer to measure time durations with high accuracy.
The measurement can be very helpful to detect performance bottlenecks.
Use the HighPerformanceTimer::precision() to retrieve the possible accuracy of this high performance timer.
The implementation is platform dependent.
◆ Ticks
◆ HighPerformanceTimer()
Ocean::HighPerformanceTimer::HighPerformanceTimer |
( |
| ) |
|
Creates a new timer and starts the time measurement.
◆ mseconds()
double Ocean::HighPerformanceTimer::mseconds |
( |
| ) |
const |
Returns the measured time since the timer has been started in milliseconds.
- Returns
- Measured milliseconds
◆ nseconds()
double Ocean::HighPerformanceTimer::nseconds |
( |
| ) |
const |
Returns the measured time since the timer has been started in nanoseconds.
- Returns
- Measured nanoseconds
◆ precision()
static Ticks Ocean::HighPerformanceTimer::precision |
( |
| ) |
|
|
static |
Returns the precision of the timer.
- Returns
- Countable ticks per seconds
◆ seconds()
double Ocean::HighPerformanceTimer::seconds |
( |
| ) |
const |
Returns the measured time since the timer has been started in seconds.
- Returns
- Measured seconds
◆ start()
void Ocean::HighPerformanceTimer::start |
( |
| ) |
|
|
inline |
(Re-)starts the time measurement.
◆ ticks()
static Ticks Ocean::HighPerformanceTimer::ticks |
( |
| ) |
|
|
static |
Returns the recent CPU ticks.
- Returns
- Recent CPU ticks
◆ ticks2seconds()
double Ocean::HighPerformanceTimer::ticks2seconds |
( |
const Ticks |
ticks | ) |
|
|
inlinestatic |
Converts a given CPU tick into seconds regarding the resolution of the timer.
- Parameters
-
ticks | The ticks to convert |
- Returns
- The Number of seconds matching with the given CPU ticks
◆ ticksPerSecond()
static Ticks Ocean::HighPerformanceTimer::ticksPerSecond |
( |
| ) |
|
|
staticprotected |
Returns the resolution of the timer in ticks per second.
- Returns
- Ticks per second
◆ yseconds()
double Ocean::HighPerformanceTimer::yseconds |
( |
| ) |
const |
Returns the measured time since the timer has been started in microseconds.
- Returns
- Measured microseconds
◆ ticksStart_
Ticks Ocean::HighPerformanceTimer::ticksStart_ = Ticks(0) |
|
protected |
The number of CPU ticks when starting the timer.
The documentation for this class was generated from the following file: