hrstopwatch

Crates.iohrstopwatch
lib.rshrstopwatch
version0.1.0
sourcesrc
created_at2022-09-08 03:18:51.57217
updated_at2022-10-07 08:38:23.502326
descriptionA high accuracy stopwatch, intended for benchmarking.
homepage
repositoryhttps://github.com/Starz0r/hrstopwatch
max_upload_size
id660759
size9,202
(Starz0r)

documentation

https://docs.rs/hrstopwatch/latest

README

High Resolution Stopwatch

GitHub crates.io badge Docs.rs rustc requirements

An extremely accurate clock for taking measurements of the length of time between it starting and stopping. Includes the capability to pause and resume. Inspired by https://github.com/moritzrinow/winwatch. Windows Only.

Usage

use hrstopwatch::Stopwatch;

let mut num: u64 = 0;
let mut stopwatch = Stopwatch::start()?;
for i in 0..10000 {
	num += i;
}
stopwatch.stop()?;
println!("seconds to calculate: {}", stopwatch.elapsed_seconds_f64());
Commit count: 10

cargo fmt