A simple timer.
#include <Timer.h>
|
void | tick () |
| Start the timer. More...
|
|
template<typename Rep = double, typename Period = std::ratio<1>> |
Rep | tock () |
| Stop the timer and return the elapsed time. More...
|
|
void Euclid::Timer::tick |
( |
| ) |
|
|
inline |
The timer is reset when tick is called.
template<typename Rep = double, typename Period = std::ratio<1>>
Rep Euclid::Timer::tock |
( |
| ) |
|
|
inline |
You could control the representation and precesion of the timer using the template arguments. The default is to count seconds in double format, like 3.14159 seconds. You could use, for example, tock<int, std::milli>()
to return integer valued milliseconds. See std::chrono for detailed explainations of these parameters. If tick is not called, tock will return 0.
- Template Parameters
-
Rep | The representational type of the elapsed time, default to double. |
Period | The unit of the elapsed time, default to second. |
The documentation for this class was generated from the following file: