std::time — blocking time. tokio::time — async time.
std::time:
tokio::time:
1use std::time::{Duration, Instant};23let start = Instant::now();4std::thread::sleep(Duration::from_secs(1));5println!("{:?}", start.elapsed());67use tokio::time::{sleep, Duration, Instant};89let start = Instant::now();10sleep(Duration::from_secs(1)).await;11println!("{:?}", start.elapsed());
Key: std for blocking, tokio for async.