tree: b6646e789f070760c23d8235b86986a58116ae4b [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. Android.bp
  10. Cargo.lock
  11. Cargo.toml
  12. Cargo.toml.orig
  13. CHANGELOG.md
  14. CONTRIBUTING.md
  15. LICENSE-APACHE
  16. LICENSE-MIT
  17. METADATA
  18. MODULE_LICENSE_APACHE2
  19. OWNERS
  20. README.md
  21. TEST_MAPPING
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();