tree: dc96d8b85323727da1b46c3a1f69d204c286f8f0 [path history] [tgz]
  1. .appveyor.yml
  2. .cargo-checksum.json
  3. .travis.yml
  4. CHANGELOG.md
  5. CONTRIBUTING.md
  6. Cargo.toml
  7. LICENSE-APACHE
  8. LICENSE-MIT
  9. README.md
  10. src/
rustc_deps/vendor/num_cpus/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();