It seems System.currentTimeMillis is not very accurate.
See this sample:
public class MillisTime {
public static void main(String[]
Yes. The javadoc for System.currentTimeMillis() says it:
Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
You could use System.nanoTime(), but make sure to read its javadoc to understand its limitations.