![]() |
Blaze
3.6
|
Progress timer for time and performance measurements.The Timer class offers timing & benchmarking functionality for all kinds of applications. The following example code demonstrates the use of the WcTimer class, which combines the Timer class template with the WcPolicy for wall clock time measurements, for a single time measurement: More...
#include <Timer.h>
Public Types | |
using | TimingPolicy = TP |
Timing policy of the Timer. | |
Public Member Functions | |
Constructors | |
Timer () | |
Constructor of the Timer class. More... | |
Timing functions | |
void | start () |
Starting a single time measurement. More... | |
void | end () |
Ending a single time measurement. More... | |
void | reset () |
Resetting the timer. More... | |
Get functions | |
size_t | getCounter () const |
Returns the total number of time measurements performed by this timer. More... | |
Time evaluation functions | |
double | total () const |
Returns the total elapsed time of all performed time measurements. More... | |
double | average () const |
Returns the average time of all performed time measurements. More... | |
double | min () const |
Returns the minimal time of all performed time measurements. More... | |
double | max () const |
Returns the maximal time of all performed time measurements. More... | |
double | last () const |
Returns the last measured time. More... | |
Private Attributes | |
size_t | counter_ |
Number of performed time measurements. | |
double | start_ |
Start of the current time measurement. | |
double | end_ |
End of the current time measurement. | |
double | time_ |
The total elapsed time of all measurements. | |
double | min_ |
The minimal time of all measurements. | |
double | max_ |
The maximal time of all measurements. | |
double | last_ |
The last measured time. | |
Progress timer for time and performance measurements.
The Timer class offers timing & benchmarking functionality for all kinds of applications. The following example code demonstrates the use of the WcTimer class, which combines the Timer class template with the WcPolicy for wall clock time measurements, for a single time measurement:
The timer class additionally offers the functionality to start several time measurments in order to evaluate minimal, maximal or average times. The next example demonstrates a possible setup for such a series of time measurements:
|
inlineexplicit |
|
inline |
Returns the average time of all performed time measurements.
|
inline |
Ending a single time measurement.
This function ends the currently running time measurement and performs the necessary statistical calculations.
|
inline |
Returns the total number of time measurements performed by this timer.
|
inline |
Returns the last measured time.
|
inline |
Returns the maximal time of all performed time measurements.
|
inline |
Returns the minimal time of all performed time measurements.
|
inline |
Resetting the timer.
This function completely resets the timer and all information on the performed time measurements. In order to start a new time measurement, the start() function has to be used.
|
inline |
Starting a single time measurement.
This function starts a single time measurement.
|
inline |
Returns the total elapsed time of all performed time measurements.