public void MoveClockForward(TimeSpan span) { CurrentUtcDateTime = CurrentUtcDateTime.AddTicks(span.Ticks); while (true) { dynamic timerInfo = null; lock (timersLock) { timerInfo = timers.FirstOrDefault(); } if (timerInfo == null) { break; } if (timerInfo.FireAt > CurrentUtcDateTime) { break; } lock (timersLock) { timers.Remove(timerInfo); } timerInfo.TaskCompletionSource.SetResult(null); } }