Trait kernel::hil::time::Time

source ·
pub trait Time {
    type Frequency: Frequency;
    type Ticks: Ticks;

    // Required method
    fn now(&self) -> Self::Ticks;
Expand description

Represents a moment in time, obtained by calling now.

Required Associated Types§


type Frequency: Frequency

The number of ticks per second


type Ticks: Ticks

The width of a time value

Required Methods§


fn now(&self) -> Self::Ticks

Returns a timestamp. Depending on the implementation of Time, this could represent either a static timestamp or a sample of a counter; if an implementation relies on it being constant or changing it should use Timestamp or Counter.