Skip to main content

PlatformClock

Trait PlatformClock 

Source
pub trait PlatformClock {
    // Required methods
    fn clock_ms() -> u64;
    fn clock_us() -> u64;
}
Expand description

Monotonic clock.

The most critical platform primitive. Must be backed by a hardware timer or OS tick — never by a software counter that only advances when polled.

Required Methods§

Source

fn clock_ms() -> u64

Returns monotonic time in milliseconds.

Source

fn clock_us() -> u64

Returns monotonic time in microseconds.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PlatformClock for CffiPlatform

Implementors§