Java Timer and scheduleAtFixedRate + System Suspend Java Timer and scheduleAtFixedRate + System Suspend multithreading multithreading

Java Timer and scheduleAtFixedRate + System Suspend


Have you looked at the API? It clearly states the following:

In fixed-rate execution, each execution is scheduled relative to the scheduled execution time of the initial execution. If an execution is delayed for any reason (such as garbage collection or other background activity), two or more executions will occur in rapid succession to "catch up." In the long run, the frequency of execution will be exactly the reciprocal of the specified period (assuming the system clock underlying Object.wait(long) is accurate).

This is one reason why you should consider using a ScheduledExecutorService. This link may also prove useful.