05 December 2013
 Stopwatch watch = new StopWatch();
 watch.Start();
 RunCode();/* Code run*/
 watch.Stop();
 string time = watch.ElapsedMilliseconds.ToString();
 ----------------------------------------
 这里用到System.Diagnostics 命名空间。测试自己代码效率和查错的时候很有用。


blog comments powered by Disqus