Skip to main content

sleep_background

Function sleep_background 

Source
pub async fn sleep_background(duration: Duration)
Expand description

Sleep on the process-global delayed-callback timer — C callbackRequestDelayed (callback.c:410) — measured on std::time.

The delay counterpart to spawn_background: a tail deferred there must wait on a timer that exists without a runtime, which tokio::time does not.