Skip to content

Add new template for "dotnet new benchmark" #1028

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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