Should we measure the average or the minimum execution time of a function?

Viewed 790

I am interested in is comparing the speed of two different functions, using same input data (BMP) for both functions.


When we measure the execution time of a function (using always same input) we don't get the same result (time) even if we should because the program runs in a multitasking environment. Even if we run our program as 'high priority' some interference from other programs will slow down our program (to simplify let consider a single core computer).

So, most people will time the function multiple times and make an average. My question is why don't we log the smallest execution time instead of average? Min exec time should be much closer to the real thing than the average execution time.

1 Answers
Related