c# - BenchmarkDotNet is showing no console and hence no output - Stack Overflow

I am using Lenovo T430, Windows 10, Visual Studio 2017, .NET 4.7.2, and BenchmarkDotNet 0.11.3.I am se

I am using Lenovo T430, Windows 10, Visual Studio 2017, .NET 4.7.2, and BenchmarkDotNet 0.11.3.

I am seeing no console.

I am seeing no output.

What am I doing incorrectly?

using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

namespace BenchmarkTest
{
    public class BenchmarkSetup
    {
        private double num1;
        private double num2;

        [GlobalSetup]
        public void Setup()
        {
            num1 = 12345.6789;
            num2 = 98765.4321;
        }

        [Benchmark]
        public double Addition() => num1 + num2;

        [Benchmark]
        public double Subtraction() => num1 - num2;

        [Benchmark]
        public double Multiplication() => num1 * num2;

        [Benchmark]
        public double Division() => num1 / num2;
    }

    public class Program
    {
        public static void Main(string[] args)
        {
            // Run the benchmark
            var summary = BenchmarkRunner.Run<BenchmarkSetup>();

            // Display completion message
            Console.WriteLine("Benchmark completed.");
            Console.ReadLine();
        }
    }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745248226a4618515.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信