Struct timer_controller::Timer

source ·
pub struct Timer {
    pub interval: f64,
    pub time: f64,
    pub next: f64,
}
Expand description

A timer relative to start of program.

Fields

interval: f64

The interval in seconds between each trigger.

time: f64

The time in seconds from start of program.

next: f64

The time of next trigger in seconds.

Implementations

Creates a new timer.

Calls closure for each interval to catch up with update time.

The timing is inaccurate for less intervals than the update interval.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.