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§

ffi
Base bindings to c code

Structs§

InstructionNumber
Represent the number of cpu instruction number
InstructionNumberInstant
InstructionNumberReader

Enums§

Error

Type Aliases§

Result