pub fn get_cpu_count() -> usizeExpand description
Returns the number of available CPU cores.
This function attempts to detect the number of available processors on the system. If detection fails, it defaults to 1.
§Returns
A usize representing the number of available CPU cores.
§Examples
use nitrite::get_cpu_count;
let cpu_count = get_cpu_count();
println!("Available CPUs: {}", cpu_count);
assert!(cpu_count > 0);