Here’s what Akka has to say about that.
The scheduler in Akka is designed for high-throughput of thousands up to millions of triggers. The prime use-case being triggering Actor receive timeouts, Future timeouts, circuit breakers and other time dependent events which happen all-the-time and in many instances at the same time.
I can hardly add anything that will clarify it’s intent further. There’s a lot of stuff going on behind the scenes that relies on time and the scheduler makes sure these tasks are executed in timely manner (pardon the pun).
It actually does not trigger it after exactly 50ms.
The default implementation of
Scheduler used by Akka is based on job buckets which are emptied according to a fixed schedule. It does not execute tasks at the exact time, but on every tick, it will run everything that is (over)due.
The default tick is set at 10ms - which is not going to be precise, mark you. So if schedule a task to run after 50ms, it will run in that vicinity
As above, it will run about 10000ms later, give or take.
There’s a single thread that handles all of the scheduled tasks.
Please note that it is recommended to use Akka Timers instead of the system scheduler, should you wish to send delayed messages. Which are going to be just as precise as the scheduler ones.