1 unstable release

0.1.0 Mar 7, 2022

#3 in #consumed

Download history 10/week @ 2026-01-05 3/week @ 2026-01-12 24/week @ 2026-01-19 24/week @ 2026-01-26 30/week @ 2026-02-02 8/week @ 2026-02-09 21/week @ 2026-02-16 23/week @ 2026-02-23 34/week @ 2026-03-02 155/week @ 2026-03-09 26/week @ 2026-03-16 22/week @ 2026-03-23 12/week @ 2026-03-30 20/week @ 2026-04-06 34/week @ 2026-04-13 23/week @ 2026-04-20

93 downloads per month
Used in 11 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