예제 #1
0
		internal int GetDelayUntilNextExecution(SimpleTimerEntry timer)
		{
			return timer.Delay - (int)(LastUpdateTime - timer.LastCallTime);
		}
예제 #2
0
		public SimpleTimerEntry CallDelayed(int delayMillis, Action callback)
		{
			var timer = new SimpleTimerEntry(delayMillis, callback, m_lastUpdate, true);
			m_timers.Add(timer);
			return timer;
		}
예제 #3
0
		/// <summary>
		/// Stops running the given timer
		/// </summary>
		public void CancelTimer(SimpleTimerEntry entry)
		{
			m_timers.Remove(entry);
		}
예제 #4
0
		public SimpleTimerEntry CallPeriodically(int delayMillis, Action callback)
		{
			var timer = new SimpleTimerEntry(delayMillis, callback, m_lastUpdate, false);
			m_timers.Add(timer);
			return timer;
		}