To get the system boot time in milliseconds in typescript, we can make use of the 'systeminformation' library which provides various system information. To install the library, run the following command:
index.ts30 chars2 lines
Then, we can use the systeminformation.uptime()
function to get the system uptime in seconds and multiply by 1000 to get the uptime in milliseconds. Here's how we can do it:
index.ts179 chars7 lines
Using the above code, we can get the system boot time in milliseconds.
gistlibby LogSnag