clock_source

Crates.ioclock_source
lib.rsclock_source
version0.2.4
sourcesrc
created_at2022-01-18 10:06:16.509563
updated_at2022-04-22 03:31:42.511843
descriptionset a common clock source
homepage
repositoryhttps://github.com/rise0chen/clock_source.git
max_upload_size
id516119
size13,126
Rise Chen (rise0chen)

documentation

README

clock_source

Usage

Add this to your Cargo.toml:

[dependencies]
clock_source = "*"
let now: u64 = clock_source::now();

custom clock source

[dependencies]
clock_source = { version = "*", features = ["custom"] }
static SOURCE: fn() -> u64 = || 1;
clock_source::register_clock_source!(SOURCE);
assert_eq!(clock_source::now(), 1);
Commit count: 19

cargo fmt