Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.ns.d.ts>Deno.loadavg

A modern runtime for JavaScript and TypeScript.
Latest
function Deno.loadavg
allow-sys
import { Deno } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.ns.d.ts";
const { loadavg } = Deno;

Returns an array containing the 1, 5, and 15 minute load averages. The load average is a measure of CPU and IO utilization of the last one, five, and 15 minute periods expressed as a fractional number. Zero means there is no load. On Windows, the three values are always the same and represent the current load, not the 1, 5 and 15 minute load averages.

console.log(Deno.loadavg());  // e.g. [ 0.71, 0.44, 0.44 ]

Requires allow-sys permission.

On Windows there is no API available to retrieve this information and this method returns [ 0, 0, 0 ].

Returns

number[]