public SimpleTimer( long lIntervalMs, SimpleTimerCallback pfCallback, string sName) : this(lIntervalMs, pfCallback, false, sName) { }
public SimpleTimer( TimeSpan oInterval, SimpleTimerCallback pfCallback, bool bStartImmediately, string sName ) : this((long)oInterval.TotalMilliseconds, pfCallback, bStartImmediately, sName) { }
// // Public // public SimpleTimer( long lIntervalMs, SimpleTimerCallback pfCallback, bool bStartImmediately, string sName ) { m_requestedInterval = lIntervalMs; m_lInterval = lIntervalMs; m_pfCallback = pfCallback; m_sName = sName; m_oEvent = new ManualResetEvent(false); m_delayer = new Delayer(m_locker); if (bStartImmediately) { Start(); } }
public static void InitTimer( ref SimpleTimer oTimer, long lIntervalMs, SimpleTimerCallback pfCallback, bool bStartImmediately, string sName) { if (oTimer != null) { ExceptionUtil.RaiseInvalidOperationException( System.Reflection.MethodInfo.GetCurrentMethod(), "Can't start timer " + sName + ", already created"); } oTimer = new SimpleTimer( lIntervalMs, pfCallback, bStartImmediately, sName ); }