Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

num_cpus

> 编程语言
Open source

Get the number of CPUs in Rust

629 stars0 likes3 views
WebsiteGitHub

About

Get the number of CPUs in Rust

num_cpus

  • Documentation
  • CHANGELOG

Count the number of CPUs on the current machine.

Usage

Add to Cargo.toml:

toml
[dependencies]
num_cpus = "1.0"

In your main.rs or lib.rs:

rust
extern crate num_cpus;

// count logical cores this process could try to use
let num = num_cpus::get();

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言