Crates.io | num_cpus |
lib.rs | num_cpus |
version | 1.16.0 |
source | src |
created_at | 2015-03-16 18:43:53.862639 |
updated_at | 2023-06-29 12:57:59.06661 |
description | Get the number of CPUs on a machine. |
homepage | |
repository | https://github.com/seanmonstar/num_cpus |
max_upload_size | |
id | 1592 |
size | 55,992 |
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();