C#计时器代码
C#写计时器:
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();//开始计时
int count=0;
for (int i = 0; i < 10000; i++)
{
count++;
}
watch.Stop();//停止计时
Console.WriteLine("共耗时:" + (watch.ElapsedMilliseconds));//输出时间--毫秒
Console.ReadKey();