Import num_cpus-1.13.0 am: 006226b774

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/num_cpus/+/1472194

Change-Id: I0e6722ec6a405114ab40794311968808a3ba98a5
tree: ece8f40720c179f3fdbd12617d6123e67f88cfda
  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();