Skip to content

Engine → Core → clock.h

stopwatch

Syntax

class CONJURE_API stopwatch

Constructors

AccessSignatureDescription
publicstopwatch() noexcept;Starts measuring on the process-wide steady clock.
publicexplicit stopwatch( const clock &source) noexcept;Starts measuring on the given clock.
publicstopwatch( const stopwatch &) noexcept = default;

Destructors

AccessSignatureDescription
public~stopwatch();

Variables

AccessNameTypeDefaultDescription
privatemClockconst clock *nullptr
privatemStartSecondsf640.0

Functions

Public

elapsed_seconds

[[nodiscard]] f64 elapsed_seconds() const noexcept;

Seconds elapsed since the last start, restart or construction.

restart

f64 restart() noexcept;

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

void start() noexcept;

Resets the origin to the current time.

Operator Overloads

Public

operator=

stopwatch &operator=(
    const stopwatch &) noexcept = default;