index : stopwatch.git

ascending towards madness

stopwatch

A small stopwatch library written in Rust.

Usage

use std::time::Duration;
use stopwatch::Stopwatch;

let mut stopwatch = Stopwatch::new();

stopwatch.start();

// Do a long running task
std::thread::sleep(Duration::from_secs(5));

stopwatch.stop();

println!("Operation complete in: {}", stopwatch);

Installation

cargo add --git https://git.holly.sh/stopwatch.git

Why does this exist?

While there is the rust-stopwatch crate, I didn't like that a simple stopwatch crate had a dependency on num, which has other dependencies.

This is done in pure Rust.

License