I wrote an actor using a scheduler every 5 milliseconds to assign a timestamp to a field.
And in the test, I found that the result (System.currentTimeMillis() - timeField) is at least 35
And if I use the scheduleAtFixedRate() method from Executors.scheduledThreadPool, the result will be correct.
So, is the scheduler delay minimal?
Answer: The default tick duration is 100 milliseconds.
source share