Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Send + Sync {
    // Required method
    fn now(&self) -> u64;
}
Expand description

A trait for obtaining the current time.

This trait abstracts time sources to enable deterministic testing. Implementations should provide monotonic time progression for scheduling decisions.

Time is represented as a 64-bit Unix timestamp (seconds since epoch).

Required Methods§

Source

fn now(&self) -> u64

Returns the current time as seconds since Unix epoch.

Implementors§