tokio::time::sleep — async sleep. std::thread::sleep — blocking sleep.
tokio::time::sleep:
std::thread::sleep:
1// Async sleep2tokio::time::sleep(Duration::from_secs(1)).await;34// Blocking sleep5std::thread::sleep(Duration::from_secs(1));
Key: tokio for async, std for blocking.