C#: 获取代码执行时间(精确到毫秒)
2021-06-11 15:04
阅读:478
标签:sleep console sed void new 执行 style frequency stop C#: 获取代码执行时间(精确到毫秒) 标签:sleep console sed void new 执行 style frequency stop 原文地址:https://www.cnblogs.com/Rainm/p/10551074.html
private void Time(int i)
{
Stopwatch sw = new Stopwatch();
sw.Start();
Thread.Sleep(i);
sw.Stop();
Console.WriteLine(sw.ElapsedTicks / (decimal)Stopwatch.Frequency * 1000);
}
评论
亲,登录后才可以留言!