Registry / utility / num-cpus

num-cpus

JSON →
library1.17.0rscratesunverified

Get the number of CPUs on a machine.

# Cargo.toml [dependencies] num_cpus = "1.17.0"
INSTALL
IMPORT
SIG · NUM-CPUS
N
num-cpus
utilityrustv1.17.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get
use num_cpus::get;

Demonstrates how to retrieve the number of logical CPUs.

use num_cpus; fn main() { let cpus = num_cpus::get(); println!("Number of CPUs: {}", cpus); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.17.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
num-cpus — cargo add num-cpus · libregistry