//引入命名空间
using System.Diagnostics;
//清空导入时间
lbImportTime.Text = "";
//开始记录时间
Stopwatch myWatch = Stopwatch.StartNew();
//记录运行时间
//====================
//停止记录时间
myWatch.Stop();
//显示运行时间
lbImportTime.Text = myWatch.ElapsedMilliseconds.ToString();
如果觉得《C#记录程序运行时间记录显示》对你有帮助,请点赞、收藏,并留下你的观点哦!