cpus
cpus returns one CpuInfo per logical CPU core.
Signature
cpus(): CpuInfo[]tyrus
import { CpuInfo, cpus } from "tyrus:os";
const cores: CpuInfo[] = cpus();
print(`${cores.length} cores, ${cores[0].model}`);CpuInfo Fields
| Field | Type | Meaning |
|---|---|---|
model | string | The CPU model name (e.g. "Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz"). |
speed | u32 | The core's frequency, in MHz. |
