C#性能测试方法

System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();
for (int i = 0; i < 100000; i++)
{
    var linq = xxx.Select(x => "000" + x);//Linq,返回IEnumerable
}
watch.Stop();

你可能感兴趣的:(性能测试)