How can I monitor CPU time of algorithm I developed in Excel vba?

  • Thread starter Thread starter Jerry
  • Start date Start date
J

Jerry

I am comparing different algorithms on a problem. I developed them in
Excel vba. How can I record the CPU time of these algorithms?

thanks!
Jerry
 
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.
 
PS....
On my MS Win XP Pro SP2 system,
Timer() has the same resolution as GetTickCount().

That was not intended to be a recommendation. If you do the resolution
tests, you might also notice that Timer() has significantly more
overhead then GetTickCount(). At least, that seems self-evident on my
MS Win XP Pro SP2 system with a 2.13 GHz Pentium CPU (single core).
 
Back
Top