num_cpus (1.17.0)
Published 2026-03-26 11:00:32 +00:00 by siennathesane
Installation
[registry]
default = "gitea"
[registries.gitea]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add num_cpus@1.17.0About this package
Get the number of CPUs on a machine.
num_cpus
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();
Dependencies
| ID | Version |
|---|---|
| libc | ^0.2.26 |
| hermit-abi | ^0.5.0 |
Keywords
cpu
cpus
cores
Details
2026-03-26 11:00:32 +00:00
Assets (1)
Versions (1)
View all
Cargo
0
Sean McArthur <sean@seanmonstar.com>
MIT OR Apache-2.0
15 KiB
num_cpus-1.17.0.crate
15 KiB
1.17.0
2026-03-26