Struct embedded_time::timer::Timer[][src]

pub struct Timer<'a, Type, State, Clock: Clock, Dur: Duration> { /* fields omitted */ }
Expand description

A Timer counts toward an expiration, can be polled for elapsed and remaining time, and can be one-shot or continuous/periodic.

Implementations

Construct a new, OneShot Timer

Change timer type to one-shot

Change timer type into periodic

Start the timer from this instant

Returns the Duration of time elapsed since it was started

The duration is truncated, not rounded.

The units of the Duration are the same as that used to construct the Timer.

Returns the Duration until the expiration of the timer

The duration is truncated, not rounded.

The units of the Duration are the same as that used to construct the Timer.

Block until the timer has expired

Check whether the timer has expired

The timer is not restarted

Block until the timer has expired

The timer is restarted

Check whether a periodic timer has elapsed

The timer is restarted if it has elapsed.

Trait Implementations

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.