Expand description
This is only for reading CpuCycles
specialization, not a complete package of perf_event_read
Example:
ⓘ
use std::{fs, time::{Duration, Instant}, thread};
use cpu_cycles_reader::{Cycles, CyclesReader, CyclesInstant};
let reader = CyclesReader::new().unwrap();
let record_1 = reader.instant(0).unwrap();
thread::sleep(Duration::from_secs(1));
let record_2 = reader.instant(0).unwrap();
let cycles = record_2 - record_1;
println!("{cycles}");
Modules§
- ffi
- Base bindings to c code
Structs§
- Cycles
- Represent the number of cpu cycles
- Cycles
Instant - Cycles
Reader