Skip to main content

sleep

Function sleep 

Source
pub fn sleep(duration: Duration) -> Sleep 
Expand description

Sleep for the specified duration 睡眠指定持续时间

§Example / 示例

use hiver_runtime::time::{sleep, Duration};

async fn example() {
    sleep(Duration::from_millis(100)).await;
    println!("Woke up after 100ms");
}