c#测试执行时间的方法时间:2023-03-09 04:11:38 获取当前实例测量出来的总的运行时间 Stopwatch sp = new Stopwatch(); sp.Start(); //要测试的代码块 sp.Stop(); Console.WriteLine(sp.Elapsed);