1 unstable release

0.1.0 Mar 7, 2022
Download history 64/week @ 2022-08-07 39/week @ 2022-08-14 36/week @ 2022-08-21 42/week @ 2022-08-28 47/week @ 2022-09-04 44/week @ 2022-09-11 40/week @ 2022-09-18 62/week @ 2022-09-25 66/week @ 2022-10-02 47/week @ 2022-10-09 19/week @ 2022-10-16 47/week @ 2022-10-23 48/week @ 2022-10-30 64/week @ 2022-11-06 57/week @ 2022-11-13 41/week @ 2022-11-20

219 downloads per month
Used in 10 crates (via clock_source)

Custom license

6KB

time-clock

Returns the processor time consumed by the program.

Usage

Add this to your Cargo.toml:

[dependencies]
time-clock = "*"
use core::time::Duration;
use std::thread;
let start = time_clock::clock();
thread::sleep(Duration::from_millis(100));
let end = time_clock::clock();
println!("start: {:?}", start);
println!("end: {:?}", end);

assert!((end - start) / time_clock::CLOCKS_PER_MILLI > 100)

No runtime deps