Crate cpu_instructions_reader

source ·
Expand description

This is only for reading CpuInstructionNumber specialization, not a complete package of perf_event_read

Example:

use std::{fs, time::{Duration, Instant}, thread};
use cpu_instructions_reader::{InstructionNumber, InstructionNumberReader, InstructionNumberInstant};

let reader = InstructionNumberReader::new().unwrap();
let record_1 = reader.instant(0).unwrap();

thread::sleep(Duration::from_secs(1));

let record_2 = reader.instant(0).unwrap();
let instructions = record_2 - record_1;

println!("{instructions}");

Modules§

  • Base bindings to c code

Structs§

Enums§

Type Aliases§