Trait TimeIf

Source
pub trait TimeIf {
    // Required methods
    fn current_ticks() -> u64;
    fn ticks_to_nanos(ticks: u64) -> u64;
    fn nanos_to_ticks(nanos: u64) -> u64;
    fn epochoffset_nanos() -> u64;
    fn set_oneshot_timer(deadline_ns: u64);
}
Expand description

Time-related interfaces.

Required Methods§

Source

fn current_ticks() -> u64

Returns the current clock time in hardware ticks.

Source

fn ticks_to_nanos(ticks: u64) -> u64

Converts hardware ticks to nanoseconds.

Source

fn nanos_to_ticks(nanos: u64) -> u64

Converts nanoseconds to hardware ticks.

Source

fn epochoffset_nanos() -> u64

Return epoch offset in nanoseconds (wall time offset to monotonic clock start).

Source

fn set_oneshot_timer(deadline_ns: u64)

Set a one-shot timer.

A timer interrupt will be triggered at the specified monotonic time deadline (in nanoseconds).

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.

Implementors§