pub fn sleep(dur: Duration) -> TimeoutFuture ⓘ
timers
futures
Waits until the specified duration has elapsed.
This function will panic if the specified Duration cannot be casted into a u32 in milliseconds.
Duration
use std::time::Duration; use gloo_timers::future::sleep; sleep(Duration::from_secs(1)).await;