get cpu freqency in rust

main.rs
extern crate sys_info;

fn main() {
    match sys_info::cpu_speed() {
        Ok(speed) => println!("CPU Frequency: {} MHz", speed),
        Err(e) => eprintln!("Error: {}", e),
    }
}
186 chars
9 lines

related categories

gistlibby LogSnag