private void Execute(IGCBenchmarkCase benchmark, ViewModel model) { Console.WriteLine(String.Format("Executing {0} ({1} runs)", benchmark.Name, TestCount)); GC.Collect(); GC.WaitForPendingFinalizers(); var gen0Count = gen0Counter.RawValue; var gen1Count = gen1Counter.RawValue; var gen2Count = gen2Counter.RawValue; for (var i = 0; i < TestCount; i++) { benchmark.Render(NullTextWriter.Instance, model); } Console.WriteLine(String.Format("GC Gen Collections - {0}/{1}/{2}", gen0Counter.RawValue - gen0Count, gen1Counter.RawValue - gen1Count, gen2Counter.RawValue - gen2Count )); }
private void Execute(IGCBenchmarkCase benchmark, ViewModel model) { Console.WriteLine(String.Format("Executing {0} ({1} runs)", benchmark.Name, TestCount)); GC.Collect(); GC.WaitForPendingFinalizers(); var gen0Count = gen0Counter.RawValue; var gen1Count = gen1Counter.RawValue; var gen2Count = gen2Counter.RawValue; for (var i = 0; i < TestCount; i++) { benchmark.Render(NullTextWriter.Instance, model); } Console.WriteLine(String.Format("GC Gen Collections - {0}/{1}/{2}", gen0Counter.RawValue - gen0Count, gen1Counter.RawValue - gen1Count, gen2Counter.RawValue - gen2Count )); }