Beispiel #1
0
 /// <summary>
 /// Uses ResetEvent to limit a process once every 'delay' milliseconds after the last time.
 /// </summary>
 /// <param name="lockObj">the lock object of the wait closure</param>
 /// <param name="delay">delay in milliseconds after the last wait</param>
 public TimedLocker(int delay, object lockObj = null) {
     _delay = delay;
     LockObject = lockObj ?? new object();
     counter = new CountdownTimer(delay);
     counter.Elapsed += () => semaphore.Release();
 }