Registry / async / async-timer

async-timer

JSON →
library0.7.4rscratesunverified

Timers for Rust async story, providing async-compatible timer functionality.

# Cargo.toml [dependencies] async-timer = "0.7.4"
INSTALL
IMPORT
SIG · ASYNC-TIMER
A
async-timer
asyncrustv0.7.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OneshotTimer
use async_timer::oneshot::OneshotTimer;

Create a one-shot timer that fires after 1 second.

use async_timer::oneshot::OneshotTimer; use std::time::Duration; #[tokio::main] async fn main() { let timer = OneshotTimer::new(Duration::from_secs(1)); timer.await; println!("Timer fired!"); }
Debug
Known issues
gotchaRequires an async runtime like Tokio or async-std.
fix
Add `tokio` or `async-std` as a dependency and use the appropriate runtime.
affects: >=0.7.0
Upgrade
Version history
0.7.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
50 hits · last 30 days
node
44
OpenAI (training)
1
Resources
async-timer — cargo add async-timer · libregistry