tree: 2ac16451de90043263a570eec6005e9d8f22234b [path history] [tgz]
  1. ci/
  2. examples/
  3. fixtures/
  4. patches/
  5. src/
  6. .android-checksum.json
  7. .cargo-checksum.json
  8. Android.bp
  9. Cargo.lock
  10. Cargo.toml
  11. cargo_embargo.json
  12. CHANGELOG.md
  13. CONTRIBUTING.md
  14. LICENSE-APACHE
  15. LICENSE-MIT
  16. METADATA
  17. MODULE_LICENSE_APACHE2
  18. README.md
  19. 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();