java - time since JVM started -
Is there any way to detect this time because JVM began?
Of course, starting a timer near the beginning of the main , because in my scenario, I am writing a library code and it is necessary that can be said immediately after the startup It's a lot of burden.
Use this snippet:
long jvmUpTime = ManagementFactory GetRuntimeMXBean () GetUptime (); or:
long jvmStartTime = ManagementFactory.getRuntimeMXBean (). GetStartTime ();
/ html>
Comments
Post a Comment