| Crates.io | ianaio-timers |
| lib.rs | ianaio-timers |
| version | 0.1.1 |
| created_at | 2024-02-18 14:24:16.065379+00 |
| updated_at | 2024-06-08 07:30:53.77145+00 |
| description | IanaIO crate for working with JavaScript timers |
| homepage | https://rustwasm.iana.io/timers/ |
| repository | https://github.com/ianaio/timers |
| max_upload_size | |
| id | 1144108 |
| size | 42,333 |
ianaio-timersBuilt with 🦀🕸 by The IanaIO Rust and WebAssembly Working Group
Working with timers on the Web: setTimeout and setInterval.
These APIs come in two flavors:
Futures and Streams API.Timeouts fire once after a period of time (measured in milliseconds).
use ianaio_timers::callback::Timeout;
let timeout = Timeout::new(1_000, move || {
// Do something after the one second timeout is up!
});
// Since we don't plan on cancelling the timeout, call `forget`.
timeout.forget();
FuturesWith the futures feature enabled, a future module containing futures-based
timers is exposed.