Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BenchmarkDotNet v0.10.14 DisassemblyDiagnoser Demo
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
</ItemGroup>
</Project>
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Running;
namespace DisasmDemo
{
[DryCoreJob, DryMonoJob, DryClrJob(Platform.X86)]
[DisassemblyDiagnoser]
public class IntroDisasm
{
[Benchmark]
public double Sum()
{
double res = 0;
for (int i = 0; i < 64; i++)
res += i;
return res;
}
}
class Program
{
static void Main() => BenchmarkRunner.Run<IntroDisasm>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment