Skip to content
Get the number of CPUs in Rust
Branch: master
Clone or download

num_cpus Travis CI Status AppVeyor status

Count the number of CPUs on the current machine.


Add to Cargo.toml:

num_cpus = "1.0"

In your or

extern crate num_cpus;

// count logical cores this process could try to use
let num = num_cpus::get();
You can’t perform that action at this time.