| Crates.io | async-tick |
| lib.rs | async-tick |
| version | 0.1.8 |
| created_at | 2022-02-23 06:26:28.19948+00 |
| updated_at | 2022-09-13 01:48:59.476254+00 |
| description | tick clock |
| homepage | |
| repository | https://github.com/rise0chen/clock_source.git |
| max_upload_size | |
| id | 537664 |
| size | 19,821 |
Add this to your Cargo.toml:
[dependencies]
async-tick = "*"
use core::time::Duration;
async_tick::tick();
let now: u64 = async_tick::now();
async_tick::sleep(Duration::from_secs(1)).await;
let interval = async_tick::interval(Duration::from_secs(1));
while let Some(now) = interval.await{
// task
}