1 unstable release

0.1.0 Mar 7, 2022

#3 in #consumed

Download history 12/week @ 2023-11-27 9/week @ 2023-12-04 13/week @ 2023-12-11 15/week @ 2023-12-18 16/week @ 2023-12-25 22/week @ 2024-01-08 7/week @ 2024-01-15 19/week @ 2024-02-05 20/week @ 2024-02-12 29/week @ 2024-02-19 43/week @ 2024-02-26 32/week @ 2024-03-04 28/week @ 2024-03-11

136 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