Skip to main content

sleep

Function sleep 

pub async fn sleep(duration: Duration)
Expand description

Wait duration, then resolve. Natively this is tokio’s timer, so it must run on a runtime with timers: the app runtime, a daemon or block_on. In a page it is one setTimeout, which a background tab may throttle.