Skip to content

cpus ​

cpus returns one CpuInfo per logical CPU core.

Signaturecpus(): CpuInfo[]
tyrus
import { CpuInfo, cpus } from "tyrus:os";

const cores: CpuInfo[] = cpus();
print(`${cores.length} cores, ${cores[0].model}`);

CpuInfo Fields ​

FieldTypeMeaning
modelstringThe CPU model name (e.g. "Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz").
speedu32The core's frequency, in MHz.