Skip to content

Engine → Core → clock.h

manual_clock

Syntax

class CONJURE_API manual_clock final : public clock

Inheritance Hierarchy

clock → manual_clock

Constructors

AccessSignatureDescription
publicmanual_clock();
publicexplicit manual_clock( f64 startSeconds);

Destructors

AccessSignatureDescription
public~manual_clock() override;

Variables

AccessNameTypeDefaultDescription
privatemNowSecondsf640.0

Functions

Public

advance

void advance(
    f64 seconds) noexcept;

Moves the clock forward by the given non-negative amount. Negative and NaN amounts assert and are ignored.

now_seconds

[[nodiscard]] f64 now_seconds() const noexcept override;

The current simulated time.

set

void set(
    f64 seconds) noexcept;

Sets the clock to an absolute time; may move it backwards.

sleep_until

void sleep_until(
    f64 seconds) override;

Jumps the clock forward to the deadline. A deadline in the past leaves the clock where it is: a manual clock never runs backwards through sleep_until.