Skip to main content

add_timer

Function add_timer 

Source
pub fn add_timer(timer: Timer) -> Timer ⓘ
Expand description

Creates a Timer whose time goes down each frame. Can be paused. Check Timer docs for more info.

§Examples

let mut my_timer = add_timer(Timer::new(5.0));

my_timer.on_completed(|| {
    println!("Timer got completed");
});