java - Stopwatch resistant against system time changes -


I want to make a stopwatch in Java, which is immune to changes in system time.

  Long start = System.nanoTime (); // System time stops longer = System.nanoTime (); Long time = start - stop;  

So the problem with this code is that when the system time is changing, the time measurement is wrong.

The above code should be resistant to changes in system time according to the API:

< Blockquote>

This method can only be used for time elapsed and is related to any other notion of system or wall clock.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -