[][src]Function rpsutil::cpu::cpu_count

pub fn cpu_count(logical: bool) -> Option<usize>

Return the number of CPUs in the system or None if undetermined. If the param is set to true, the result will be the number of logical CPUs, false will return the number of physical CPUs.


// Get the number of logical CPUs.
let logical = rpsutil::cpu::cpu_count(true);

// Get the number of physical CPUs.
let physical = rpsutil::cpu::cpu_count(false);