Skip to main content

cpu_count

Function cpu_count 

Source
pub fn cpu_count() -> usize
Expand description

Get the number of available CPU cores.

Returns the number of logical CPU cores available on the system. Falls back to 1 if detection fails.

ยงExamples

use lamina_platform::detection::cpu_count;
let cores = cpu_count();
println!("System has {} CPU cores", cores);