Open helderdaniel opened 5 years ago
Fixed this in my fork and created a pull request.
Fixed this in my fork and created a pull request.
Hi, I have tested the original which indeed drifts. And then your fork, with precisely the same code, but for whatever reason the recurring event doesn't seem triggered at all. Did someone else experienced the same issue?
Hi,
When computing the time for the next periodic execution of the task, the execution time of the task itself is not taken into consideration.
The effect is that at each task run, the execution time slot will be delayed by the time that the task took to execute.
Let’s say we start a task with period 10 secs and execution time of about 4 secs:
We can see that each run is started 14 secs after the last, not 10:
To make an accurate scheduler, that starts the task with the period specified, it is needed to subtract the execution time of the task to the next period, thus having execution times for each run with the period specified: