C#耗时计算

System.Diagnostics.Stopwatch watch = new Stopwatch();
            watch.Start();
//init();计算耗时的方法
   watch.Stop();
   var mSeconds=watch.ElapsedMilliseconds;
   MessageBox.Show("耗时:"+mSeconds.ToString());

 

转载于:https://www.cnblogs.com/aijiao/p/10144841.html

你可能感兴趣的:(C#耗时计算)