mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
886 B
26 lines
886 B
namespace ImageProcessorCore.Benchmarks
|
|
{
|
|
using System;
|
|
using System.Reflection;
|
|
|
|
using BenchmarkDotNet.Attributes;
|
|
using BenchmarkDotNet.Running;
|
|
using System.Linq;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
// Use reflection for a more maintainable way of creating the benchmark switcher,
|
|
Type[] benchmarks = typeof(Program).Assembly.GetTypes()
|
|
.Where(t => t.GetMethods(BindingFlags.Instance | BindingFlags.Public)
|
|
.Any(m => m.GetCustomAttributes(typeof(BenchmarkAttribute), false).Any()))
|
|
.OrderBy(t => t.Namespace)
|
|
.ThenBy(t => t.Name)
|
|
.ToArray();
|
|
|
|
BenchmarkSwitcher benchmarkSwitcher = new BenchmarkSwitcher(benchmarks);
|
|
benchmarkSwitcher.Run(args);
|
|
}
|
|
}
|
|
}
|
|
|