Skip to content
Get the number of CPUs in Rust
Branch: master
Clone or download
Latest commit 2c75816 Feb 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src v1.10.0 Feb 11, 2019
.appveyor.yml
.gitignore v0.1.0 Mar 16, 2015
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md

README.md

num_cpus

crates.io Travis CI Status AppVeyor 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();
You can’t perform that action at this time.