Process.resourceUsage - Node documentation
method Process.resourceUsage

Usage in Deno

import { type Process } from "node:process";
Process.resourceUsage(): ResourceUsage
import { resourceUsage } from 'node:process';

console.log(resourceUsage());
/*
  Will output:
  {
    userCPUTime: 82872,
    systemCPUTime: 4143,
    maxRSS: 33164,
    sharedMemorySize: 0,
    unsharedDataSize: 0,
    unsharedStackSize: 0,
    minorPageFault: 2469,
    majorPageFault: 0,
    swappedOut: 0,
    fsRead: 0,
    fsWrite: 8,
    ipcSent: 0,
    ipcReceived: 0,
    signalsCount: 0,
    voluntaryContextSwitches: 79,
    involuntaryContextSwitches: 1
  }

Return Type

the resource usage for the current process. All of these values come from the uv_getrusage call which returns a [uv_rusage_t struct][uv_rusage_t].