simple/simple.rs
1use took::Timer;
2
3pub fn main() {
4 // Create the stopwatch, start automatically
5 let took = Timer::new();
6
7 // Simulate heavy task running 1 second
8 std::thread::sleep(std::time::Duration::from_secs(1));
9
10 // Report elapsed time in human readable format
11 println!("Done! Took {}", took.took());
12}