precision

Low overhead, high precision measurement crate

9 releases

0.1.8 Aug 22, 2018
0.1.7 Aug 22, 2018

#28 in Profiling

Download history 5/week @ 2018-10-12 28/week @ 2018-10-19 11/week @ 2018-10-26 32/week @ 2018-11-02 46/week @ 2018-11-09 19/week @ 2018-11-16 10/week @ 2018-11-23 65/week @ 2018-11-30 29/week @ 2018-12-07 41/week @ 2018-12-14 19/week @ 2018-12-21 57/week @ 2018-12-28 5/week @ 2019-01-04

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

~191KB