pub trait Timer:
Send
+ Sync
+ 'static {
// Required methods
fn sleep(&self, dur: Duration) -> Pin<Box<dyn Future<Output = ()> + Send>>;
fn next_tick(&self) -> Pin<Box<dyn Future<Output = ()> + Send>>;
}Expand description
Async scheduling primitive. Single port for “wait N ms” / “yield event-loop tick”.