Async sleep
Rust
#![allow(unused)]
fn main() {
use std::time::Duration;
use tokio::time;
time::sleep(Duration::from_secs(2)).await;
}
Python
import async
await asyncio.sleep(2)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
#![allow(unused)]
fn main() {
use std::time::Duration;
use tokio::time;
time::sleep(Duration::from_secs(2)).await;
}
import async
await asyncio.sleep(2)