karyon_core/async_util/
sleep.rs

1
2
3
4
5
6
pub async fn sleep(duration: std::time::Duration) {
    #[cfg(feature = "smol")]
    smol::Timer::after(duration).await;
    #[cfg(feature = "tokio")]
    tokio::time::sleep(duration).await;
}