time-clock 0.1.0

Clock program
Documentation
  • Coverage
  • 0%
    0 out of 6 items documented0 out of 1 items with examples
  • Size
  • Source code size: 11.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.07 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • rise0chen/clock_source
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rise0chen

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)