Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Sized {
    const TICKS_PER_SEC: u64;

    // Required method
    fn now() -> Instant<Self>;
}
Expand description

A trait for retrieving the current system or hardware time.

Required Associated Constants§

Source

const TICKS_PER_SEC: u64

The number of clock ticks per second.

Required Methods§

Source

fn now() -> Instant<Self>

Returns the current time Instant according to this clock.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§