Function time::sleep

Overview
async fn sleep(duration: Duration)

Waits until duration has elapsed.

Examples

use time::Duration;

let duration = Duration::from_secs(10);
time::sleep(duration).await;
println!("Surprise!");