Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/workflows/ | 03-May-2024 | - | 167 | 145 | ||
ci/cgroups/ | 03-May-2024 | - | 10 | 5 | ||
examples/ | 03-May-2024 | - | 7 | 5 | ||
fixtures/cgroups/ | 03-May-2024 | - | 45 | 32 | ||
patches/ | 03-May-2024 | - | 13 | 11 | ||
src/ | 03-May-2024 | - | 879 | 626 | ||
.cargo_vcs_info.json | D | 03-May-2024 | 94 | 6 | 6 | |
.gitignore | D | 03-May-2024 | 18 | 3 | 2 | |
Android.bp | D | 03-May-2024 | 2.3 KiB | 79 | 74 | |
CHANGELOG.md | D | 03-May-2024 | 1.7 KiB | 138 | 71 | |
CONTRIBUTING.md | D | 03-May-2024 | 513 | 17 | 10 | |
Cargo.lock | D | 03-May-2024 | 607 | 27 | 23 | |
Cargo.toml | D | 03-May-2024 | 1 KiB | 27 | 25 | |
Cargo.toml.orig | D | 03-May-2024 | 561 | 19 | 15 | |
LICENSE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-APACHE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | D | 03-May-2024 | 1 KiB | 21 | 16 | |
METADATA | D | 03-May-2024 | 377 | 20 | 19 | |
MODULE_LICENSE_APACHE2 | D | 03-May-2024 | 0 | |||
OWNERS | D | 03-May-2024 | 40 | 2 | 1 | |
README.md | D | 03-May-2024 | 729 | 29 | 19 | |
TEST_MAPPING | D | 03-May-2024 | 1.4 KiB | 79 | 78 | |
cargo2android.json | D | 03-May-2024 | 382 | 19 | 18 |
README.md
1# num_cpus 2 3[](https://crates.io/crates/num_cpus) 4[](https://travis-ci.org/seanmonstar/num_cpus) 5[](https://ci.appveyor.com/project/seanmonstar/num-cpus) 6 7- [Documentation](https://docs.rs/num_cpus) 8- [CHANGELOG](CHANGELOG.md) 9 10Count the number of CPUs on the current machine. 11 12## Usage 13 14Add to Cargo.toml: 15 16```toml 17[dependencies] 18num_cpus = "1.0" 19``` 20 21In your `main.rs` or `lib.rs`: 22 23```rust 24extern crate num_cpus; 25 26// count logical cores this process could try to use 27let num = num_cpus::get(); 28``` 29