Thursday, June 3, 2010

Measure code execution time in C#

To time a part of the code in a loop, use ResetTimingValue() before you enter the loop. Than use StartTiming() and AddTimingValue() to get the combined execution time of the code in the loop.

This test uses all the functions of the ExecutionTimer: