API Reference › Clock
namespace

Clock

A game-controlled simulated clock: a single seconds counter the game owns. Unlike Time.now / Time.since, it never reads the wall clock, so any gameplay that reads Clock.now() is deterministic and replay-safe. Set it outright, or advance it by a Duration each tick to run time at whatever rate the simulation wants. The clock is a plain instant (seconds since 1970), so all the DateTime.* readers work on it directly.

Clock.now() -> intThe current simulated instant.Clock.set(t)Set the clock to an instant.Clock.advance(span)Move the clock forward by a Duration.Clock.reset()Reset the clock to the epoch (0).
← All symbols