| Crates.io | num_cpu |
| lib.rs | num_cpu |
| version | 1.14.0 |
| created_at | 2021-11-16 14:44:05.749923+00 |
| updated_at | 2021-11-18 08:33:22.071214+00 |
| description | Get the number of CPUs on a machine. |
| homepage | |
| repository | https://github.com/skerkour/black-hat-rust |
| max_upload_size | |
| id | 482794 |
| size | 1,990 |
Count the number of CPUs on the current machine.
Add to Cargo.toml:
[dependencies]
num_cpu = "1.0"
In your main.rs or lib.rs:
// count logical cores this process could try to use
let num = num_cpu::get();