Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
const os = require('os'); // Get system uptime in seconds const uptime = os.uptime(); console.log(`System Uptime: ${uptime} seconds`); // Format uptime in a more readable way const uptimeDays = Math.floor(uptime / (60 * 60 * 24)); const uptimeHours = Math.floor((uptime % (60 * 60 * 24)) / (60 * 60)); const uptimeMinutes = Math.floor((uptime % (60 * 60)) / 60); const uptimeSeconds = Math.floor(uptime % 60); console.log(`System has been running for: ${uptimeDays} days, ${uptimeHours} hours, ${uptimeMinutes} minutes, ${uptimeSeconds} seconds`);
System Uptime: 1234567 seconds System has been running for: 14 days, 6 hours, 56 minutes, 7 seconds