Struct timer_controller::Timer [−][src]
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.
Methods
impl Timer[src]
impl Timerpub fn new(interval: f64) -> Timer[src]
pub fn new(interval: f64) -> TimerCreates a new timer.
pub fn event<E: GenericEvent, F: FnMut()>(&mut self, e: &E, f: F)[src]
pub fn event<E: GenericEvent, F: FnMut()>(&mut self, e: &E, f: F)Calls closure for each interval to catch up with update time.
The timing is inaccurate for less intervals than the update interval.