码迷,mamicode.com
首页 > Windows程序 > 详细

C# StopWatch

时间:2018-07-12 16:22:02      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:efi   ISE   star   tor   time   dir   edm   direct   sed   

 1         static void Main(string[] args)
 2         {
 3 
 4             Stopwatch watch = new Stopwatch();
 5             watch.Start();
 6             Console.WriteLine("Time1 = " + watch.ElapsedMilliseconds);
 7             IEnumerable<string> lsFiles = Directory.EnumerateFiles(@"D:\", "*.*", SearchOption.AllDirectories);
 8             Console.WriteLine("Time2 = " + watch.ElapsedMilliseconds);
 9             foreach (var item in lsFiles)
10             {
11 
12             }
13             Console.WriteLine("Time3 = " + watch.ElapsedMilliseconds);
14             watch.Stop();
15             watch.Restart();
16             Console.WriteLine("Time3 = " + watch.ElapsedMilliseconds);
17             watch.Stop();
18         }

 

C# StopWatch

标签:efi   ISE   star   tor   time   dir   edm   direct   sed   

原文地址:https://www.cnblogs.com/wyvern0618/p/9299452.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!