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(); } }
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(); } } }