private async Task Benchmark() { Algorithm currentAlgorithm = null; while (_benchmarkAlgorithmQueue.Count > 0) { try { if (_stopBenchmark.IsCancellationRequested) { break; } currentAlgorithm = _benchmarkAlgorithmQueue.Dequeue(); _benchmarkForm.AddToStatusCheck(Device, currentAlgorithm); await BenchmarkAlgorithm(currentAlgorithm); if (_stopBenchmark.IsCancellationRequested) { break; } _benchmarkForm.StepUpBenchmarkStepProgress(); ConfigManager.CommitBenchmarksForDevice(Device); } catch (Exception e) { Helpers.ConsolePrint($"BenchmarkHandler-{Device.GetFullName()}", $"Exception {e}"); } } currentAlgorithm?.ClearBenchmarkPending(); // don't show unbenchmarked algos if user canceled if (_stopBenchmark.IsCancellationRequested) { return; } _benchmarkForm.EndBenchmarkForDevice(Device, _benchmarkFailedAlgo.Count > 0); }
private void EndBenchmark() { _currentAlgorithm?.ClearBenchmarkPending(); _benchmarkForm.EndBenchmarkForDevice(Device, _benchmarkFailedAlgo.Count > 0); }