Skip to content

Add new template for "dotnet new benchmark" #1028

@adamsitnik

Description

@adamsitnik

I think that we should add a new template for dotnet cli that would create following app when used:

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

namespace BenchmarkApp
{
    class Program
    {
        static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
    }

    public class TypeWithBenchmarks
    {
        [Benchmark]
        public int YourBenchmark()
        {
            // implement your benchmark here
            return 0;
        }
    }
}

@AndreyAkinshin what do you think?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions