#clock #source #register

clock_source

set a common clock source

7 releases

0.2.4 Apr 22, 2022
0.2.3 Mar 7, 2022
0.2.2 Feb 21, 2022
0.2.1 Jan 19, 2022
0.1.1 Jan 18, 2022

#70 in #clock

41 downloads per month
Used in 10 crates (5 directly)

Custom license

12KB

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);

Dependencies