Stopwatch myWatch = new Stopwatch();
myWatch.Start();
for (int i = 0; i < 1000; i++)
{
Console.WriteLine("just test" + i);
}
myWatch.Stop();
long myUseTime = myWatch.ElapsedMilliseconds;
MessageBox.Show("执行时间: " + myUseTime.ToString() + " ms");
C# 代码执行时间
最新推荐文章于 2023-10-24 10:05:05 发布