What is the best way to measure how long code takes to execute?

后端 未结 10 1264
梦谈多话
梦谈多话 2020-12-08 04:04

I\'m trying to determine which approach to removing a string is the fastest.

I simply get the start and end time a

10条回答
  •  天涯浪人
    2020-12-08 04:30

    If you're only worried about testing it in your own code...use a System.Diagnostics.Stopwatch

    I usually prefer breaking this kind of thing out of my code and using a true Profiler like RedGate's Performance Profiler

提交回复
热议问题