Crates.io | supply-chain-trust-example-crate-000062 |
lib.rs | supply-chain-trust-example-crate-000062 |
version | 1.16.0 |
source | src |
created_at | 2024-11-04 00:05:25.539923 |
updated_at | 2024-11-04 00:05:25.539923 |
description | Get the number of CPUs on a machine. |
homepage | |
repository | |
max_upload_size | |
id | 1434394 |
size | 56,167 |
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();