futures
需要单独的包 futures_timer
use std::time::Duration;
use futures_timer::Delay;
let now = Delay::new(Duration::from_secs(3)).await;
println!("waited for 3 secs");
async-std
use async_std::task;
use std::time::Duration;
task::sleep(time::Duration::from_secs(1)).await;
smol
use smol::Timer;
use std::time::Duration;
Timer::after(Duration::from_secs(1)).await;