precision

Low overhead, high precision measurement crate

10 releases

✓ Uses Rust 2018 edition

0.1.9 Mar 12, 2019
0.1.8 Aug 22, 2018

#22 in Profiling

Download history 2/week @ 2019-01-20 3/week @ 2019-01-27 4/week @ 2019-02-03 1/week @ 2019-02-17 10/week @ 2019-02-24 49/week @ 2019-03-03 51/week @ 2019-03-10 29/week @ 2019-03-17 260/week @ 2019-03-24 110/week @ 2019-03-31 52/week @ 2019-04-07 47/week @ 2019-04-14 76/week @ 2019-04-21 46/week @ 2019-04-28

177 downloads per month
Used in 1 crate

ISC license

10KB
212 lines

Precision

Precision is a simple crate to perform measurements using hardware counters.

It is especially useful for performing micro-benchmarks.

API documentation

Example

extern crate precision;

let p = precision::Precision::new(precision::Config::default()).unwrap();

let start = p.now();
let stop = p.now();
let elapsed1 = stop - start;

let start = p.now();
let stop = p.now();
let elapsed2 = stop - start;

let elapsed_total = elapsed1 + elapsed2;
let elapsed_total_secs = elapsed_total.as_secs_f64(&p);
let hw_ticks = elapsed_total.ticks();

lib.rs:

Precision is a simple crate to perform measurements using hardware counters.

It is especially useful for performing micro-benchmarks.

Example

extern crate precision;

let p = precision::Precision::new(precision::Config::default()).unwrap();

let start = p.now();

let stop = p.now();
let elapsed1 = stop - start;

let start = p.now();
let stop = p.now();
let elapsed2 = stop - start;

let elapsed_total = elapsed1 + elapsed2;
let elapsed_total_secs = elapsed_total.as_secs_f64(&p);
let hw_ticks = elapsed_total.ticks();

Dependencies

~317KB