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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -