Measures time.
More...
#include <classes/timer.h>
|
| Timer () noexcept |
| Constructs an instance with the current time as the starting point. More...
|
|
void | tic () noexcept |
| Resets the chronometer. More...
|
|
const Timer & | toc () noexcept |
| Stops the chronometer. More...
|
|
double | seconds () const noexcept |
| Time passed in seconds. More...
|
|
|
std::chrono::steady_clock::time_point | _start |
|
std::chrono::steady_clock::time_point | _end |
|
|
template<typename charT , typename traits > |
std::basic_ostream< charT, traits > & | operator<< (std::basic_ostream< charT, traits > &os, const Timer &rhs) |
| Overload for std::ostream operators. More...
|
|
Measures time.
Uses a std::chrono::steady_clock. It is not affected by wall clock changes during runtime.
Constructs an instance with the current time as the starting point.
double qpp::Timer::seconds |
( |
| ) |
const |
|
inlinenoexcept |
Time passed in seconds.
- Returns
- Number of seconds that passed between the instantiation/reset and invocation of qpp::Timer::toc()
Resets the chronometer.
Resets the starting/ending point to the current time
const Timer& qpp::Timer::toc |
( |
| ) |
|
|
inlinenoexcept |
Stops the chronometer.
Set the current time as the ending point
- Returns
- Current instance
template<typename charT , typename traits >
std::basic_ostream<charT, traits>& operator<< |
( |
std::basic_ostream< charT, traits > & |
os, |
|
|
const Timer & |
rhs |
|
) |
| |
|
friend |
Overload for std::ostream operators.
- Parameters
-
os | Output stream |
rhs | Timer instance |
- Returns
- Writes to the output stream the number of seconds that passed between the instantiation/reset and invocation of qpp::Timer::toc().
std::chrono::steady_clock::time_point qpp::Timer::_end |
|
protected |
std::chrono::steady_clock::time_point qpp::Timer::_start |
|
protected |
The documentation for this class was generated from the following file: