async-tick
Usage
Add this to your Cargo.toml
:
[]
= "*"
use Duration;
tick;
let now: u64 = now;
sleep.await;
let interval = interval;
while let Some = interval.await
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
}