Duration duration,
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 duration.

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.