num_cpus

Crates.ionum_cpus
lib.rsnum_cpus
version1.16.0
sourcesrc
created_at2015-03-16 18:43:53.862639
updated_at2023-06-29 12:57:59.06661
descriptionGet the number of CPUs on a machine.
homepage
repositoryhttps://github.com/seanmonstar/num_cpus
max_upload_size
id1592
size55,992
Sean McArthur (seanmonstar)

documentation

https://docs.rs/num_cpus

README

num_cpus

crates.io CI Status

Count the number of CPUs on the current machine.

Usage

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();
Commit count: 168

cargo fmt