ludus::platform::PacingClock¶
Ludus Wiki · API overview · Browse API
Struct
Injected monotonic time source and wait primitive for FramePacer.
Production loops use GetSystemPacingClock(). Unit tests supply a synthetic clock whose wait advances simulated time, so pacing policy is tested without sleeping. Both functions are called only on the thread that calls Pace().
Declared in modules/platform/include/ludus/platform/frame_pacing.h
#include <ludus/platform/frame_pacing.h>
struct ludus::platform::PacingClock final
Fields¶
ReadNowOrNull¶
foundation::time::Timestamp(*) ludus::platform::PacingClock::ReadNowOrNull(void *contextOrNull) noexcept(void *contextOrNull) noexcept = nullptr
Return the current monotonic reading in the FoundationTime domain. Null makes Pace() report InvalidClock.
Related types: foundation::time::Timestamp
Declared in modules/platform/include/ludus/platform/frame_pacing.h
WaitForOrNull¶
PacingWaitStatus(*) ludus::platform::PacingClock::WaitForOrNull(void *contextOrNull, foundation::time::Duration interval) noexcept(void *contextOrNull, foundation::time::Duration interval) noexcept = nullptr
Block for about
interval (never zero). May return early or late; the pacer rereads the clock after every return. Null makes Pace() report InvalidClock. Related types: PacingWaitStatus
Declared in modules/platform/include/ludus/platform/frame_pacing.h
ContextOrNull¶
void* ludus::platform::PacingClock::ContextOrNull = nullptr
Opaque state passed to both functions; owned by the caller and kept alive across Pace().
Declared in modules/platform/include/ludus/platform/frame_pacing.h