asr::future

Function interval

Source
pub fn interval(duration: Duration) -> Interval
Available on WASI only.
Expand description

A type that provides futures that resolve in fixed intervals.

ยงExample

let mut interval = interval(Duration::from_secs(1));
loop {
    interval.tick().await;
    print_message("A second has passed!");
}