Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 308 Bytes

cpu-count.zh.md

File metadata and controls

13 lines (9 loc) · 308 Bytes

检查逻辑 CPU 的核数

[![num_cpus-badge]][num_cpus] [![cat-hardware-support-badge]][cat-hardware-support]

[num_cpus::get]会显示当前计算机中,使用的逻辑 CPU 核数。

extern crate num_cpus;

fn main() {
    println!("Number of logical cores is {}", num_cpus::get());
}