Model.TimerComponent.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
		public void Update()
		{
			long timeNow = TimeHelper.Now();
			foreach (long time in this.timeId.Keys)
			{
				if (time > timeNow)
				{
					break;
				}
				this.timeoutTimer.Enqueue(time);
			}

			while (this.timeoutTimer.Count > 0)
			{
				long key = this.timeoutTimer.Dequeue();
				long[] timeOutId = this.timeId.GetAll(key);
				foreach (long id in timeOutId)
				{
					Timer timer;
					if (!this.timers.TryGetValue(id, out timer))
					{
						continue;
					}
					this.Remove(id);
					timer.tcs.SetResult(true);
				}
			}
		}