Hi! I want to measure cpu time in SAS ODA. The time seems to vary with +/- 5% (sometimes even more).
So I can run, the same program say 10 times. Then add the values (user cpu time and system cpu time) from the log, divide by 10. Is there any better way?
CPU and (particularly) real time is highly dependent on external factors like number of processes competing for resources. So it is prudent to run programs multiple times and take the mean.
If your goal is benchmarking (comparing the efficiency of different techniques) I usually run each version 5 times, sum up the CPU time and sum up the elapsed time, and divide those totals by 5 to get the number I use for comparison.
CPU and (particularly) real time is highly dependent on external factors like number of processes competing for resources. So it is prudent to run programs multiple times and take the mean.