Get system uptime in Java
In Windows, you can execute the net stats srv command, and in Unix, you can execute the uptime command. Each output must be parsed to acquire the uptime. This method automatically executes the necessary command by detecting the user’s operating system. Note that neither operation returns uptime in millisecond precision. public static long getSystemUptime() throws … Read more