Functor for the timer class which assigns the run-time to a given variable. More...
Public Types | |
typedef double | result_type |
Public Member Functions | |
reference_timer () | |
Default constructor. | |
reference_timer (double *_runtime) | |
Default constructor. | |
double | operator() (double r) const |
Saves the run-time to the variable. |
Functor for the timer class which assigns the run-time to a given variable.
Make sure that the variable for the run-time is declared outside of the scope of time measuring.
double runtime; { revkit::reference_timer rt( &runtime ); revkit::timer<revkit::reference_timer> t( rt ); // code for which time should be measured }
typedef double result_type |
Result value of the reference_timer is double, since it returns the value of the reference value, the run-time in the operator call. This is only useful, when using the intermediate measurement in timer.
reference_timer | ( | ) | [inline] |
Default constructor.
Available for delayed starting of the timer.
reference_timer | ( | double * | _runtime | ) | [inline, explicit] |
Default constructor.
_runtime | A pointer referencing to the variable where the run-time should be saved. |
double operator() | ( | double | r | ) | const [inline] |
Saves the run-time to the variable.
r | The run-time |