Crate async_timer
source ·Expand description
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
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 thanlibc.std- Enables usage of std types (e.g. Error)stream- EnablesStreamimplementation forInterval
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 module
- Raw Timer
Structs
- Error when Timed expires
- Periodic Timer
- Limiter on time to wait for underlying
Future
Functions
- Creates interval with default Platform timer.
- Creates timed future with default Platform timer.