System.currentTimeMillis vs System.nanoTime
If you’re just looking for extremely precise measurements of elapsed time, use System.nanoTime(). System.currentTimeMillis() will give you the most accurate possible elapsed time in milliseconds since the epoch, but System.nanoTime() gives you a nanosecond-precise time, relative to some arbitrary point. From the Java Documentation: public static long nanoTime() Returns the current value of the most … Read more