tree: 708018eaf284a2260f946ebf77c97254945d6761 [path history] [tgz]
  1. .github/
  2. ci/
  3. examples/
  4. fixtures/
  5. patches/
  6. src/
  7. .cargo_vcs_info.json
  8. .gitignore
  9. Android.bp
  10. Cargo.toml
  11. Cargo.toml.orig
  12. cargo_embargo.json
  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 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();