Skip to content
Related Articles

Related Articles

Node.js process.resourceUsage() Function

Improve Article
Save Article
  • Last Updated : 06 Apr, 2021
Improve Article
Save Article

The process object is a global that provides information about, and control over, the current Node.js process. As a global, it is always available to Node.js applications without using require(). It can also be explicitly accessed using require() function.

process.resourceUsage() is a new method that returns resource usage for the current process.



Parameters: This function does not accept any parameter.

Return Value: It returns the resource usage for the current process. All of these values come from the uv_getrusage call which returns a uv_rusage_t struct.

Below examples illustrate the use of the process.resourceUsage() property in Node.js:



// Node.js program to demonstrate the  
// process.resourceUsage() Property  
// Include process module  
const process = require('process');  
// Printing process.resourceUsage() property value  

Command to run:

node index.js


Note: The above program will compile and run by using the node filename.js command.


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!