Exemplo n.º 1
0
        private void AddWork(TimeSpan delay, Action work, CancellationToken token)
        {
            var expected      = HighResMonotonicClock + delay;
            var scheduledWord = new ScheduledWork(expected.Ticks, work, token);

            _workQueue.Enqueue(scheduledWord);
        }
Exemplo n.º 2
0
        private void AddWork(TimeSpan delay, Action work, CancellationToken token)
        {
            if (_stopped.Value != null)
            {
                throw new SchedulerException("cannot enque after timer shutdown");
            }
            var expected      = HighResMonotonicClock + delay;
            var scheduledWord = new ScheduledWork(expected.Ticks, work, token);

            _workQueue.Enqueue(scheduledWord);
        }
 private void AddWork(TimeSpan delay, Action work,CancellationToken token)
 {
     var expected = HighResMonotonicClock + delay;
     var scheduledWord = new ScheduledWork(expected.Ticks, work,token);
     _workQueue.Enqueue(scheduledWord);
 }               
 private void AddWork(TimeSpan delay, Action work, CancellationToken token)
 {
     if (_stopped.Value != null)
         throw new SchedulerException("cannot enque after timer shutdown");
     var expected = HighResMonotonicClock + delay;
     var scheduledWord = new ScheduledWork(expected.Ticks, work, token);
     _workQueue.Enqueue(scheduledWord);
 }