tree: ece8f40720c179f3fdbd12617d6123e67f88cfda [path history] [tgz]
  1. ci/
  2. examples/
  3. fixtures/
  4. src/
  5. .appveyor.yml
  6. .cargo_vcs_info.json
  7. .gitignore
  8. .travis.yml
  9. Cargo.lock
  10. Cargo.toml
  11. Cargo.toml.orig
  12. CHANGELOG.md
  13. CONTRIBUTING.md
  14. LICENSE-APACHE
  15. LICENSE-MIT
  16. 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();