C# 耗时记录

记录程序的运行耗时时间

System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();

//Code

watch.Stop();
var mSeconds = watch.ElapsedMilliseconds;
Dialog.Write("耗时:" + mSeconds.ToString());

  

posted @ 2021-08-03 09:14  microsoft-zhcn  阅读(103)  评论(0编辑  收藏  举报