#timer #macro

simple-timer

simple timer macro

1 unstable release

0.1.0 Jul 4, 2019

#190 in #timer

MIT license

3KB

simple timer

Usage

In Cargo.toml:

[dependencies]
simple-timer = { git = 'https://github.com/hwchen/simple-timer-rs' }

In code:

use simple_timer::timeit;

fn hello_world() {
    println!("hello world");
}

fn main() -> {
    timeit!("time_1", hello_world());
    timeit!("time_two",
        {
            println!("great weather");
            println!("i agree");
        }
    );
    let forty_two = timeit!("three", 42);
    assert_eq!(forty_two, 42);
}

License

MIT

No runtime deps