advance method
Advances the time to dateTime. If omitted advance to the timestamp of
the next scheduled action. If no scheduled action is present, keep the
current timestamp and only flush pending immediate actions.
Implementation
void advance([DateTime? dateTime]) {
_currentTime = dateTime ?? scheduled.firstKey() ?? _currentTime;
flush();
}