Table of Contents

Method Advance

Namespace
KZDev.PrimeTime.Testing
Assembly
KZDev.PrimeTime.Testing.dll

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.

public void Advance(Duration duration)

Parameters

duration Duration

The 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.

public void Advance(TimeSpan duration)

Parameters

duration TimeSpan

The 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).