I have a long running task and I would like to schedule a new run a fixed interval after the run ends and I found this. What does the following mean? In particular the last paragraph.
Timer.periodic(Duration duration, Function void callback(Timer timer))
Creates a new repeating timer.
The callback is invoked repeatedly with duration intervals until
canceled with the cancel function.
The exact timing depends on the underlying timer implementation. No
more than n callbacks will be made in duration * n time, but the time
between two consecutive callbacks can be shorter and longer than
In particular, an implementation may schedule the next callback, e.g.,
a duration after either when the previous callback ended, when the
previous callback started, or when the previous callback was scheduled
for - even if the actual callback was delayed.
Let's say you set a timer to run every 30 seconds. If the second time the callback is called it takes 10 seconds to complete, the third call to the callback could be: