Andreas Göbel <an************@sap.com> wrote:
Hi all,
I'm looking for an approach to simply measure the performance (time
consumption in milliseconds) of a single method call. I already tried
to use the windows system time (sys/timeb.h) for that but the
accuracy of the result is too low (moves between 0 and 10
milliseconds). Is there any possibility to measure more precises
without using an external (costly) profiler or does anybody know a
free profiler on windows?
Instead of measuring the time it takes to execute the functions
once, you could measure the time it takes to execute the function
1,000,000 times. Or 4,000,000, depending on how expensive your function
is.
If we are talking about tiny functions, then the loop could have
undesired relative impact on the timing. In that case I suggest you take
a look at the assembly, strop the function call (or inlined function
code) from it and measure the time it takes to execute the empty loop.
hth
--
jb
(reply address in rot13, unscramble first)