List of all members | Public Types | Public Member Functions
reference_timer Struct Reference

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. More...
 
 reference_timer (double *_runtime)
 Default constructor. More...
 
double operator() (double r) const
 Saves the run-time to the variable. More...
 

Detailed Description

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.

Example

double runtime;
{
revkit::reference_timer rt( &runtime );
// code for which time should be measured
}
Author
RevKit
Since
1.0

Member Typedef Documentation

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.

See Also
timer::operator()()
Author
RevKit
Since
1.0

Constructor & Destructor Documentation

reference_timer ( )
inline

Default constructor.

Available for delayed starting of the timer.

Author
RevKit
Since
1.0
reference_timer ( double *  _runtime)
inlineexplicit

Default constructor.

Parameters
_runtimeA pointer referencing to the variable where the run-time should be saved.
Author
RevKit
Since
1.0

Member Function Documentation

double operator() ( double  r) const
inline

Saves the run-time to the variable.

Parameters
rThe run-time
Author
RevKit
Since
1.0

The documentation for this struct was generated from the following file:

Generated on Tue Apr 16 2013 08:12:02 for RevKit by doxygen 1.8.3.1