I\'ve written an application in java and I want to add a feature to report the uptime of the application. Is there a Class/method in the JVM that can do this?
Should
You can use RuntimeMXBean.getUptime()
RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean(); long uptime = rb.getUptime();