C# 使用 Stopwatch 测量代码运行时间

System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
System.Threading.Thread.Sleep(
3000);
sw.Stop();
Console.WriteLine(sw.Elapsed);

 

posted on 2010-08-31 14:16  大豆男生  阅读(411)  评论(0编辑  收藏  举报

导航