tree: b00109a90ae4969726f478df6802d28aaa45e1ec [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. 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();