using System.Collections.Generic;
using System.Diagnostics;
private static void Benchmark(Action act, int iterations)
Stopwatch sw = Stopwatch.StartNew();
for (int i = 0; i < iterations; i++)
Console.WriteLine((sw.ElapsedTicks).ToString());
public static void Main(string[] args)
var nom = new List<int>();
for (int i = 0; i < 1000000; i++)
nom.Add(rand.Next(1000));
Benchmark(() => { nom.FirstOrDefault(x => x > 100); }, 100000);
Benchmark(() => { nom.Where(x => x > 100).FirstOrDefault(); }, 100000);