Processor

Check number of logical cpu cores

num_cpus-badge cat-hardware-support-badge

Add the num_cpus crate to your own project:

cargo add num_cpus

Shows the number of logical CPU cores in current machine using [num_cpus::get].

use num_cpus;

fn main() {
    println!("Number of logical cores is {}", num_cpus::get());
}