[−][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
- Timer interface to one-shot Platform Timer, may require event loop.
- SyncTimer interface to one-shot Platform Timer, does not require event loop.
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
tokio02
- Enables event loop based timers using tokio 0.2, providing higher accuracy than regular callback based timers on Linux/BSD/Apple platforms.tokio03
- Enables event loop based timers using tokio 0.3, providing higher resolution timer astokio02
.c_wrapper
- Uses C shim to create bindings to platform API, which may be more reliable thanlibc
.
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 |
Functions
interval | Creates interval with default Platform timer. |
timed | Creates timed future with default Platform timer. |