码迷,mamicode.com
首页 > 其他好文 > 详细

Watch time

时间:2017-11-16 17:19:32      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:stopwatch   nbsp   new   mes   star   min   display   form   ++   

 1    Stopwatch watch = new Stopwatch();
 2             watch.Start();
 3           
 4             for (int i = 0; i <= 9; i++)
 5             {
 6                 for (int j = 0; j <= 9; j++)
 7                 {
 8                     for (int k = 0; k <= 9; k++)
 9                     {
10                         for (int m = 0; m <= 9; m++)
11                         {
12                             if (i + "" + j + "" + k + "" + m == "8549")
13                             {
14                                 watch.Stop();
15 
16                                 // Get the elapsed time as a TimeSpan value.
17                                 TimeSpan ts = watch.Elapsed;
18 
19                                 // Format and display the TimeSpan value.
20                                 string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
21                                     ts.Hours, ts.Minutes, ts.Seconds,
22                                     ts.Milliseconds / 10);
23                                 Console.WriteLine("RunTime " + elapsedTime);
24                                 Console.ReadLine();
25                             }
26                            
27                             
28                         }
29                     }
30                 }

 

Watch time

标签:stopwatch   nbsp   new   mes   star   min   display   form   ++   

原文地址:http://www.cnblogs.com/kejie/p/7845057.html

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