Function sleep_until
Source pub fn sleep_until(instant: Instant) -> SleepUntil ⓘ
Expand description
Sleep until the specified instant
睡眠直到指定时刻
§Example / 示例
ⓘuse hiver_runtime::time::{sleep_until, Instant, Duration};
async fn example() {
let deadline = Instant::now() + Duration::from_secs(5);
sleep_until(deadline).await;
println!("5 seconds have passed");
}