Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
//要测试的方法
stopWatch.Stop();
Trace.WriteLine(stopWatch.ElapsedTicks.ToText());