[][src]Crate async_timer

Async timer lib

Accuracy

Regular timers that do not rely on async event loop tend to be on par with user space timers like in tokio. If that's not suitable for you you should enable event loop based timers which in most cases give you the most accurate timers possible on unix platforms (See features.)

Timers

Primitives

  • Timed - A wrapper over future that allows to limit time for the future to resolve.
  • Interval - Periodic timer, that on each completition returns itself to poll once again with the same interval.

Features

  • tokio1 - Enables event loop based timers using tokio, providing higher resolution timers on unix platforms.
  • c_wrapper - Uses C shim to create bindings to platform API, which may be more reliable than libc.
  • std - Enables usage of std types (e.g. Error)
  • stream - Enables Stream implementation for Interval

Re-exports

pub use state::Callback;
pub use timer::SyncTimer;
pub use timer::Timer;
pub use timer::new_sync_timer;
pub use timer::new_timer;

Modules

state

State module

timer

Raw Timer

Structs

Expired

Error when Timed expires

Interval

Periodic Timer

Timed

Limiter on time to wait for underlying Future

Functions

interval

Creates interval with default Platform timer.

timed

Creates timed future with default Platform timer.