Exemplo n.º 1
0
 private void TimerCallback(Object o)
 {
     timeLeft = timeLeft > countingSpeed ? timeLeft - countingSpeed : 0;
     log?.Log($"\r{_message} | {timeLeft.ToString("F2")} sec left");
     if (timeLeft == 0)
     {
         CompletionEvent.Set(); timer.Dispose(); GC.Collect();
     }
 }
Exemplo n.º 2
0
 public void SetComplete()
 {
     lock (mSync)
     {
         if (IsComplete)
         {
             RFStatic.Log.Info(typeof(RFProcessingTracker), "Second completion event for request {0}", ProcessingKey);
         }
         else
         {
             RFStatic.Log.Info(typeof(RFProcessingTracker), "First completion event for request {0}", ProcessingKey);
             CyclesRemaining(0);
             ProcessingCycles = 0;
             IsComplete       = true;
             EndTime          = DateTimeOffset.Now;
             CompletionEvent.Set();
         }
     }
 }