elapsed

Crates.ioelapsed
lib.rselapsed
version0.1.2
sourcesrc
created_at2017-04-01 14:20:03.116331
updated_at2017-04-03 21:37:30.775744
descriptionMeasure execution time of a block of code
homepage
repositoryhttps://github.com/matklad/elapsed.git
max_upload_size
id9300
size6,371
owners (github:badrobotics:owners)

documentation

https://docs.rs/crate/elapsed/0.1.2

README

Time a block of Rust code

Build Status Docs crates.io

[dependencies]
elapsed = "0.1"
extern crate elapsed;
use elapsed::measure_time;

fn main() {
    let (elapsed, sum) = measure_time(|| {
        (0..10_000).sum::<u64>()
    });
    println!("elapsed = {}", elapsed);
    println!("sum = {}", sum);

    // Prints
    // elapsed = 227.81 μs
    // sum = 49995000
}

Inspired by measureTimeMillis in Kotlin.

Commit count: 9

cargo fmt