clock.h¶
| File Path | engine/include/conjure/core/clock.h |
| API ↗ | Time, events and random |
A monotonic time source measured in seconds. The epoch is implementation defined: only differences between two readings of the same clock are meaningful.
Classes¶
| File | Description |
|---|---|
clock |
A monotonic time source measured in seconds. The epoch is implementation defined: only differences between two readings of the same clock are meaningful. |
manual_clock |
A clock that only moves when told to. Starts at zero. Used by tests and by tools that step the engine deterministically. |
steady_clock |
Real time from std::chrono::steady_clock. Seconds count from the first use of any steady_clock in the process, so readings start near zero and keep full double precision. Every instance reads the same underlying time. |
stopwatch |
Measures elapsed time on a clock. Runs from construction; start() and restart() reset the origin. The clock is referenced, not owned, and must outlive the stopwatch. |
Functions¶
Public¶
default_clock¶
default_clock¶[[nodiscard]] CONJURE_API clock &default_clock() noexcept;The process-wide steady clock. Use it when no clock was injected.
ticks_now¶
ticks_now¶[[nodiscard]] CONJURE_API u64 ticks_now() noexcept;Raw steady-clock ticks for profiling. Convert differences with ticks_to_seconds.