precision

Low overhead, high precision measurement crate

9 releases

0.1.8 Aug 22, 2018
0.1.7 Aug 22, 2018

#17 in Profiling

Download history 98/week @ 2018-08-23 36/week @ 2018-08-30 20/week @ 2018-09-06 5/week @ 2018-09-13 17/week @ 2018-09-20 41/week @ 2018-09-27 22/week @ 2018-10-04 6/week @ 2018-10-11 28/week @ 2018-10-18 12/week @ 2018-10-25

29 downloads per month

ISC license

10KB
214 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();

Dependencies

~188KB