howmuch

Crates.iohowmuch
lib.rshowmuch
version0.1.2
sourcesrc
created_at2018-01-17 22:32:24.467335
updated_at2018-01-19 05:20:21.720783
descriptionMeasure elapsed time by tagged sections
homepage
repositoryhttps://github.com/anton-dutov/howmuch-rs
max_upload_size
id47240
size5,370
Anton Dutov (anton-dutov)

documentation

README

howmuch

Measure elapsed time by tagged sections

Example

extern crate howmuch;

use howmuch::HowMuch;

use std::time::Duration;
use std::thread;

fn main() {

    let mut hm = HowMuch::new();

    thread::sleep(Duration::new(1,0));

    hm.tag("SLEEP 1s");

    thread::sleep(Duration::new(2,0));

    hm.tag("SLEEP 2s");

    thread::sleep(Duration::new(3,0));

    hm.tag("SLEEP 3s");

}

Output

0.000000 |    0.000000 | BEGIN
1.000100 |    1.000099 | SLEEP 1s
3.000249 |    2.000148 | SLEEP 2s
6.000419 |    3.000170 | SLEEP 3s
6.000426 |    0.000005 | END
Commit count: 4

cargo fmt