#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

#64 in #clock

Download history 17/week @ 2024-07-20 39/week @ 2024-07-27 23/week @ 2024-08-03 20/week @ 2024-08-10 17/week @ 2024-08-17 19/week @ 2024-08-24 31/week @ 2024-08-31 20/week @ 2024-09-07 16/week @ 2024-09-14 34/week @ 2024-09-21 24/week @ 2024-09-28 2/week @ 2024-10-05 19/week @ 2024-10-12 11/week @ 2024-10-19 6/week @ 2024-10-26 16/week @ 2024-11-02

52 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