Skip to content

Instantly share code, notes, and snippets.

View abz98's full-sized avatar
👽

abhi abz98

👽
View GitHub Profile
@GaetanoPiazzolla
GaetanoPiazzolla / avgLoad.js
Last active May 20, 2024 07:13
% CPU in Node.JS
const os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores