Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
ci/cgroups/ | 03-May-2024 | - | 10 | 5 | ||
examples/ | 03-May-2024 | - | 7 | 5 | ||
fixtures/cgroups/ | 03-May-2024 | - | 27 | 16 | ||
src/ | 03-May-2024 | - | 872 | 640 | ||
.appveyor.yml | D | 03-May-2024 | 423 | 17 | 16 | |
.cargo_vcs_info.json | D | 03-May-2024 | 74 | 6 | 5 | |
.gitignore | D | 03-May-2024 | 18 | 3 | 2 | |
.travis.yml | D | 03-May-2024 | 2.2 KiB | 82 | 50 | |
Android.bp | D | 03-May-2024 | 1.9 KiB | 59 | 54 | |
CHANGELOG.md | D | 03-May-2024 | 1.6 KiB | 132 | 68 | |
CONTRIBUTING.md | D | 03-May-2024 | 513 | 17 | 10 | |
Cargo.lock | D | 03-May-2024 | 939 | 27 | 23 | |
Cargo.toml | D | 03-May-2024 | 1 KiB | 28 | 26 | |
Cargo.toml.orig | D | 03-May-2024 | 570 | 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 | 370 | 18 | 16 | |
MODULE_LICENSE_APACHE2 | D | 03-May-2024 | 0 | |||
OWNERS | D | 03-May-2024 | 40 | 2 | 1 | |
README.md | D | 03-May-2024 | 725 | 29 | 19 | |
cargo2android.json | D | 03-May-2024 | 195 | 11 | 11 |
README.md
1# num_cpus 2 3[![crates.io](http://meritbadge.herokuapp.com/num_cpus)](https://crates.io/crates/num_cpus) 4[![Travis CI Status](https://travis-ci.org/seanmonstar/num_cpus.svg?branch=master)](https://travis-ci.org/seanmonstar/num_cpus) 5[![AppVeyor status](https://ci.appveyor.com/api/projects/status/qn8t6grhko5jwno6?svg=true)](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