How to calculate running time of a java program

Use System.nanoTime(), it returns the current value of the running Java Virtual Machine’s ( Please check JVM internal details ) high-resolution time source in nanoseconds.

Running time of a Java program

Returns

It returns the current value of the running Java Virtual Machine’s high-resolution time source, in nanoseconds

Leave a Reply

avatar
  Subscribe  
Notify of