使用StopWtch
Stopwatchsw=new Stopwatch() sw.Start(); sw.Stop(); sw.ElapsedMilliseconds;//毫秒 sw.ElapsedTicks;高精度刻尺微秒