Sample: IntroGenericTypeArguments
Source code
using System;
using BenchmarkDotNet.Attributes;
namespace BenchmarkDotNet.Samples
{
[GenericTypeArguments(typeof(int))]
[GenericTypeArguments(typeof(char))]
public class IntroGenericTypeArguments<T>
{
[Benchmark] public T Create() => Activator.CreateInstance<T>();
}
}
Links
- The permanent link to this sample: BenchmarkDotNet.Samples.IntroGenericTypeArguments