tree: 3b95278f2b7b8a2b6a6c29d3d36707547c4c3c46 [path history] [tgz]
  1. ci/
  2. examples/
  3. fixtures/
  4. patches/
  5. src/
  6. .cargo-checksum.json
  7. Android.bp
  8. Cargo.lock
  9. Cargo.toml
  10. cargo_embargo.json
  11. CHANGELOG.md
  12. CONTRIBUTING.md
  13. LICENSE-APACHE
  14. LICENSE-MIT
  15. METADATA
  16. MODULE_LICENSE_APACHE2
  17. README.md
  18. TEST_MAPPING
crates/num_cpus/README.md

num_cpus

crates.io CI 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();