This class works as a stopwatch.
More...
#include <cxxtimer.h>
This class works as a stopwatch.
Definition at line 37 of file cxxtimer.h.
◆ Timer() [1/3]
| cxxtimer::Timer::Timer |
( |
bool |
start = false | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
| start | If true, the timer is started just after construction. Otherwise, it will not be automatically started. |
Definition at line 130 of file cxxtimer.h.
◆ Timer() [2/3]
| cxxtimer::Timer::Timer |
( |
const Timer & |
other | ) |
|
|
default |
Copy constructor.
- Parameters
-
| other | The object to be copied. |
◆ Timer() [3/3]
| cxxtimer::Timer::Timer |
( |
Timer && |
other | ) |
|
|
default |
Transfer constructor.
- Parameters
-
| other | The object to be transferred. |
◆ ~Timer()
| virtual cxxtimer::Timer::~Timer |
( |
| ) |
|
|
virtualdefault |
◆ count()
template<class duration_t >
| duration_t::rep cxxtimer::Timer::count |
Return the elapsed time.
- Parameters
-
| duration_t | The duration type used to return the time elapsed. If not specified, it returns the time as represented by std::chrono::milliseconds. |
- Returns
- The elapsed time.
Definition at line 169 of file cxxtimer.h.
◆ operator=() [1/2]
| Timer& cxxtimer::Timer::operator= |
( |
const Timer & |
other | ) |
|
|
default |
Assignment operator by copy.
- Parameters
-
| other | The object to be copied. |
- Returns
- A reference to this object.
◆ operator=() [2/2]
| Timer& cxxtimer::Timer::operator= |
( |
Timer && |
other | ) |
|
|
default |
Assignment operator by transfer.
- Parameters
-
| other | The object to be transferred. |
- Returns
- A reference to this object.
◆ reset()
| void cxxtimer::Timer::reset |
( |
| ) |
|
|
inline |
◆ start()
| void cxxtimer::Timer::start |
( |
| ) |
|
|
inline |
Start/resume the timer.
Definition at line 139 of file cxxtimer.h.
◆ stop()
| void cxxtimer::Timer::stop |
( |
| ) |
|
|
inline |
◆ accumulated_
| std::chrono::duration<long double> cxxtimer::Timer::accumulated_ |
|
private |
◆ paused_
| bool cxxtimer::Timer::paused_ |
|
private |
◆ reference_
| std::chrono::steady_clock::time_point cxxtimer::Timer::reference_ |
|
private |
◆ started_
| bool cxxtimer::Timer::started_ |
|
private |
The documentation for this class was generated from the following file: