simple-stopwatch 0.1.3

Minimal stopwatch for rust, returns float values
Documentation

rust-simple-stopwatch

Build Status

What is it?

A minimal no-thrills stopwatch. Returns time values as floats. Uses time::precise_time_ns under the hood.

Setup

Add the dependency simple-stopwatch to your Cargo.toml file, for example:

[dependencies]
simple-stopwatch="0.1.3"

Then import the stopwatch anywhere you would like to use it:

extern crate simple_stopwatch;
use simple_stopwatch::Stopwatch;

Example Use

fn my_function() {
  let sw = Stopwatch::start_new();
  
  do_some_heavy_work();
  
  let elapsed_ms = sw.ms();
  println!("Time taken: {}ms", elapsed_ms);
}

Inspiration / Other Projects