| Crates.io | num_cpus |
| lib.rs | num_cpus |
| version | 1.17.0 |
| created_at | 2015-03-16 18:43:53.862639+00 |
| updated_at | 2025-05-30 18:59:42.537878+00 |
| description | Get the number of CPUs on a machine. |
| homepage | |
| repository | https://github.com/seanmonstar/num_cpus |
| max_upload_size | |
| id | 1592 |
| size | 55,998 |
Count the number of CPUs on the current machine.
Add to Cargo.toml:
[dependencies]
num_cpus = "1.0"
In your main.rs or lib.rs:
extern crate num_cpus;
// count logical cores this process could try to use
let num = num_cpus::get();