The value of System.currentTimeMillis() might jump if the system
wall-clock is changed e.g. by NTP. Therefore it should not be used for
measuring elapsed time.
System.nanoTime() is not affected by time steps of the system wall-clock
and can better be used for measuring elapsed time.
The value of System.currentTimeMillis() might jump if the system wall-clock is changed e.g. by NTP. Therefore it should not be used for measuring elapsed time.
System.nanoTime() is not affected by time steps of the system wall-clock and can better be used for measuring elapsed time.