Crates.io | supply-chain-trust-example-crate-000070 |
lib.rs | supply-chain-trust-example-crate-000070 |
version | 1.16.1 |
created_at | 2024-11-04 00:31:30.584921+00 |
updated_at | 2025-03-18 06:47:14.64972+00 |
description | Get the number of CPUs on a machine. |
homepage | |
repository | |
max_upload_size | |
id | 1434412 |
size | 55,896 |
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();