Crate tokio_hrtime

Crate tokio_hrtime 

Source
Expand description

Hires timers for tokio.

This is a drop-in replacement of tokio::time. The API is a 1:1 replication. Please refer to the doc there.

Timers with the highest possible resolution from the operating system are used. The feature time of tokio is not used and is not required. Sub-millisecond granularity is achieved with:

  • timerfd in Linux (and Android).
  • kqueue with EVFILT_TIMER in *BSD and Apple’s Darwin; specifically, NOTE_MACHTIME is used in Darwin to obtain the similar resolution to GCD.
  • CreateWaitableTimerEx with CREATE_WAITABLE_TIMER_HIGH_RESOLUTION in Windows.

Re-exports§

pub use std::time::Duration;
pub use std::time::Instant;

Modules§

error

Structs§

Interval
Sleep
Timeout

Enums§

MissedTickBehavior

Functions§

interval
interval_at
sleep
sleep_until
timeout
timeout_at