public async Task TenK_WithNormalTimers() { List <Task> timers = new List <Task>(this.timeouts.Count); List <WorkerWithTimer> workers = new List <WorkerWithTimer>(this.timeouts.Count); for (int i = 0; i < this.timeouts.Count; i++) { WorkerWithTimer timer = new WorkerWithTimer(this.timeouts[i]); timers.Add(timer.StartTimerAsync()); } await Task.WhenAll(timers); foreach (WorkerWithTimer item in workers) { item.Dispose(); } }
public async Task One_WithNormalTimers() { WorkerWithTimer timer = new WorkerWithTimer(50); await timer.StartTimerAsync(); }