Skip to main content

Module clock

Module clock 

Source
Expand description

Platform-agnostic clock abstraction.

Provides a Clock enum that can be either real system time or mock time for testing. The clock is shared across all threads within a runtime instance.

  • Native: Uses system time via the time module
  • WASM: Uses JavaScript’s Date.now() via the time module

Structs§

Instant
MockClock
Mock clock with atomic time storage for thread-safe access.

Enums§

Clock
A clock that provides time - either real system time or mock time for testing.