using System.Collections.Generic;
using System.Diagnostics;
public static void Main()
Stopwatch stopwatch = new Stopwatch();
TimeSpan elapsedTimeA = stopwatch.Elapsed;
Console.WriteLine("Elapsed time for Test A: " + elapsedTimeA);
TimeSpan elapsedTimeB = stopwatch.Elapsed;
Console.WriteLine("Elapsed time for Test B: " + elapsedTimeB);
public static bool TestMethodA()
var cats = new List<string>()
if (cats.Any(x => x.ToLower().Contains("yzzyzz")))
public static bool TestMethodB()
var cats = new List<string>()
if (cats.Any(x => x.IndexOf("yzzyzz", StringComparison.OrdinalIgnoreCase) >= 0))