From 71131cadc36beb5ac5b25e562d6506b36cceb60f Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Fri, 10 Apr 2026 03:05:20 +0200 Subject: [PATCH] delete CountingUnit --- .../ProcessorThroughputBenchmark.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs index 8d3471012f..790077beff 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs @@ -11,7 +11,6 @@ namespace SixLabors.ImageSharp.Tests.ProfilingSandbox; public sealed class ProcessorThroughputBenchmark { - private const ulong CountingUnit = 1; private readonly CommandLineOptions options; private readonly Configuration configuration; private ulong totalPixelsInUnit; @@ -90,7 +89,7 @@ public sealed class ProcessorThroughputBenchmark } await Task.Yield(); // "emulate IO", i.e., make sure the processing code is async - ulong pixels = (ulong)action() / CountingUnit; + ulong pixels = (ulong)action(); Interlocked.Add(ref this.totalPixelsInUnit, pixels); } catch (Exception ex) @@ -118,7 +117,7 @@ public sealed class ProcessorThroughputBenchmark await drainTcs.Task; stopwatch.Stop(); - double totalMegaPixels = this.totalPixelsInUnit * (double)CountingUnit / 1_000_000.0; + double totalMegaPixels = this.totalPixelsInUnit / 1_000_000.0; double totalSeconds = stopwatch.ElapsedMilliseconds / 1000.0; double megapixelsPerSec = totalMegaPixels / totalSeconds; Console.WriteLine($"TotalSeconds: {totalSeconds:F2}");