(C#)记录程序运行时间

使用Stopwatch类 在使用前需要添加引用:using System.Diagnostics; static void Main(string[] args) { string s =null; //创建一个计时器,用来记录程序的运行时间 Stopwatch sw = new Stopwatch(); sw.Start();//开始计时 for (int i = 0; i < 100; i++
相关文章
相关标签/搜索