C# StopWatch

2021-03-29 17:24

阅读:669

标签: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             IEnumerablestring> 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


评论


亲,登录后才可以留言!