8 releases

0.1.8 Sep 13, 2022
0.1.7 Apr 22, 2022
0.1.5 Mar 11, 2022
0.1.1 Feb 23, 2022

#1137 in Asynchronous

33 downloads per month
Used in 3 crates (2 directly)

Custom license

15KB
264 lines

async-tick

Usage

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
}

Dependencies

~0.7–1MB
~18K SLoC