Struct pconvert_rust::benchmark::Benchmark  [−][src]
pub struct Benchmark { /* fields omitted */ }Expand description
Holds the times for read, write and blend operations.
Implementations
Returns the total time (in milliseconds), i.e., the sum of read, write and blend times.
Executes the function to benchmark and adds the time spent
to a certain counter with the given target_fn.
use pconvert_rust::benchmark::Benchmark;
use pconvert_rust::utils::read_png_from_file;
let mut benchmark = Benchmark::new();
let demultiply = false;
let path = "path/to/file.png".to_owned();
let top = benchmark.execute(Benchmark::add_read_png_time, || {
   read_png_from_file(path, demultiply)
}).unwrap();Adds time spent blending to the blend time counter.
Adds time spent reading to the read time counter.
Adds time spent writing to the write time counter.