命名空间:System.DiagnosticsStopwatch watch = new Stopwatch();watch.Start();watch.Stop();Console.WriteLine(watch.ElapsedMilliseconds + "毫秒");
转:https://www.cnblogs.com/yhyjy/p/3455303.html