Skip to content

Instantly share code, notes, and snippets.

class Benchmark
{
[Test]
public void RunTypes()
{
var cache = typeof(string).Assembly.GetTypes().ToDictionary(x => x, x => x.Name.Length);
var sum = 0;
var sw = Stopwatch.StartNew();
var n = 1000000;
for (var i = 0; i < n; i++)