|
BoosterSeat
0.1
A C++ library that includes common utilities that are used in other projects.
|
A manually controlled stopwatch that does not use the system clock. More...
#include <stopwatch.hpp>
Public Member Functions | |
| SoftwareStopwatch ()=default | |
| ~SoftwareStopwatch ()=default | |
| int64_t | elapsedMicroseconds () const |
| double | elapsedMicrosecondsF () const |
| int64_t | elapsedMilliseconds () const |
| double | elapsedMillisecondsF () const |
| int64_t | elapsedSeconds () const |
| double | elapsedSecondsF () const |
| bool | isRunning () const |
| void | pause () |
| void | reset (bool stop=true) |
| void | resume () |
| void | start () |
| void | stop () |
| void | tick (int64_t microseconds) |
| void | tickIfRunning (int64_t microseconds) |
Protected Types | |
| enum class | State { RUNNING , STOPPED } |
| The state of the stopwatch. More... | |
Protected Member Functions | |
| int64_t | getElapsed () const |
Private Attributes | |
| int64_t | elapsed_ = 0 |
| int64_t | start_ = 0 |
| State | state_ = State::STOPPED |
| int64_t | stop_time_ = 0 |
A manually controlled stopwatch that does not use the system clock.
|
strongprotectedinherited |
|
default |
|
default |
|
inlinevirtual |
Implements bst::IStopwatch.
References bst::IStopwatch::RUNNING, start_, state_, and bst::IStopwatch::STOPPED.
Referenced by resume().
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_, bst::IStopwatch::RUNNING, start_, state_, stop_time_, and bst::IStopwatch::STOPPED.
Referenced by pause(), and reset().
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_, state_, stop(), and bst::IStopwatch::STOPPED.
|
inlinevirtual |
Implements bst::IStopwatch.
References bst::IStopwatch::RUNNING, and state_.
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_.
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_.
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_.
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_.
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_.
|
inlinevirtual |
Implements bst::IStopwatch.
References elapsed_.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
References elapsed_, bst::IStopwatch::RUNNING, and state_.
|
inline |
|
inlineprotected |
References elapsed_, bst::IStopwatch::RUNNING, start_, state_, and stop_time_.
|
private |
Referenced by getElapsed(), start(), and stop().
|
private |
Referenced by getElapsed(), and stop().
|
private |
|
private |
Referenced by getElapsed(), isRunning(), reset(), start(), stop(), and tickIfRunning().