uptime
method of OS
module of node.js
This method is used to get the system uptime in seconds.
This method returns Integer
. Code snippet is given below :
//Name of the file: uptime.js
var os = require('os');
var value = os.uptime();
console.log("os.uptime() => " + value);
>node uptime.js
os.uptime() => 22906.6507529