Skip to main content

MonotonicClock

Trait MonotonicClock 

Source
pub trait MonotonicClock:
    Send
    + Sync
    + 'static {
    // Required method
    fn now_nanos(&self) -> u64;
}
Expand description

A monotonic nanosecond time source for cycle telemetry.

Implementations return nanoseconds elapsed since an arbitrary fixed epoch. The value must be monotonic non-decreasing within one clock instance; the epoch itself is unspecified (telemetry only ever takes differences).

Required Methods§

Source

fn now_nanos(&self) -> u64

Nanoseconds since this clock’s epoch. Monotonic non-decreasing.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§