How to delay aka scheduler?

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.

+4
source share
2 answers

Akka has pretty extensive documentation .

Here's an excerpt:

"The default Scheduler implementation used by Akka is based on Netty HashedWheelTimer. It does not perform tasks at the exact time, but on every tick it starts everything that has expired. The default scheduler accuracy can be changed by the ticks per wheel and" checkmark. "For more information, see HashedWheelTimers.

+1
source

All Articles