Method Advance
Advance(Duration)
Advances the clock's virtual time by the specified duration. Pending delays (Sleep, DelayAsync) that are due by the new time complete, time-based cancellation tokens that expire by the new time are cancelled, and any interval or day-time timers that are due are invoked.
void Advance(Duration duration)
Parameters
durationDurationThe amount of virtual time to add to the current instant.
Advance(TimeSpan)
Advances virtual time forward by marching to each earliest due instant up to the new horizon, then dispatching delays, time expiries, and timers at each step.
void Advance(TimeSpan duration)
Parameters
durationTimeSpanThe amount of virtual time to add to the current time.
Remarks
Negative duration is treated as zero (no backward move). Each callback runs while
UtcNowDateTimeOffset equals that event's firing instant. ClockEvents
is raised once per distinct virtual instant visited during the march (including a raise when
duration is zero).