Returns the processor time consumed by the program.
Add this to your Cargo.toml
:
toml
[dependencies]
time-clock = "*"
```rust use core::time::Duration; use std::thread; let start = timeclock::clock(); thread::sleep(Duration::frommillis(100)); let end = time_clock::clock(); println!("start: {:?}", start); println!("end: {:?}", end);
assert!((end - start) / timeclock::CLOCKSPER_MILLI > 100) ```