Get the number of CPUs in Rust
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src v1.8.0 Dec 29, 2017
.appveyor.yml add appveyor ci May 25, 2017
.gitignore v0.1.0 Mar 16, 2015
.travis.yml Add test for Travis CPU counts (#53) Sep 16, 2017
CHANGELOG.md v1.8.0 Dec 29, 2017
CONTRIBUTING.md improve readme Sep 28, 2017
Cargo.toml v1.8.0 Dec 29, 2017
LICENSE-APACHE Relicense as MIT/Apache-2.0. May 11, 2016
LICENSE-MIT Relicense as MIT/Apache-2.0. May 11, 2016
README.md add readme to Cargo.toml Sep 28, 2017

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();