Jerry said:
I am comparing different algorithms on a problem. I developed them in
Excel vba. How can I record the CPU time of these algorithms?
See
http://support.microsoft.com/kb/q172338 . Note that the VBA
Timer() function might behave differently between Microsoft Windows and
a Macintosh, according to VBA help. On my MS Win XP Pro SP2 system,
Timer() has the same resolution as GetTickCount(). Also note that
there are many complex factors to consider when interpreting the timing
results, regardless of what function you choose to use. To mention a
couple: (1) the overhead of the timer function relative to the code to
be measured; and (2) extraneous CPU overhead due to interrupts and
higher-priority processes running during the timing interval. To get a
feel for those factors, try implementing the resolution loops similar
to those described in the aforementioned KB. Execute the sub 10 or
more times and note the variation in the loop count, and less so in the
resolution.