Skip to main content

Module timer

Module timer 

Source
Expand description

Runtime-agnostic timers.

The crate promises to work on any executor, so it cannot reach for tokio::time. One background thread owns a deadline heap and resolves a oneshot per expiry, which is enough for the handful of deadlines Web Bluetooth actually needs — a scan window, a connect timeout — without spawning a thread per sleep.

Functions§

sleep
Complete after duration.
timeout
Run future, giving up after duration.