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