Crate tick_counter

source ·
Expand description

Hardware-based tick counters for high-precision benchmarks

  • x86_64 - executes RDTSC CPU instruction to read the time-stamp counter.
  • AArch64 - reads value of the CNTVCT_EL0 counter-timer register.

Basic usage

 use tick_counter::*;
 let start = tick_counter_start();
 // ... lines of code to benchmark
 let elapsed_ticks = tick_counter_stop() - start;
 println!("Number of elapsed ticks: {}", elapsed_ticks);

Enums

Functions