Engine → Core → clock.h
stopwatch
Syntax
class CONJURE_API stopwatch
Constructors
| Access | Signature | Description |
| public | stopwatch() noexcept; | Starts measuring on the process-wide steady clock. |
| public | explicit stopwatch(
const clock &source) noexcept; | Starts measuring on the given clock. |
| public | stopwatch(
const stopwatch &) noexcept = default; | |
Destructors
| Access | Signature | Description |
| public | ~stopwatch(); | |
Variables
| Access | Name | Type | Default | Description |
| private | mClock | const clock * | nullptr | |
| private | mStartSeconds | f64 | 0.0 | |
Functions
Public
elapsed_seconds
[[nodiscard]] f64 elapsed_seconds() const noexcept;
Seconds elapsed since the last start, restart or construction.
restart
Returns the elapsed seconds and resets the origin to the current time in one reading, so consecutive intervals add up without gaps.
source
[[nodiscard]] const clock &source() const noexcept;
The clock being measured.
start
Resets the origin to the current time.
Operator Overloads
Public
operator=