At 07:17 PM 6/27/01 -0400, Yacketta, Ronald wrote:
>Folks,
>
>What would be the most efficient, accurate way to time a sub
>routine/function/script?
>I am looking to time some parsing routines in my perl script, but need it to
>be
>accurate and not cause overhead/skew the output.
>
>I have looked at the benchmark module, but am not to sure about it.
>Should I be looking elsewhere?
If you're concerned about a time interval so small that the overhead
imposed by Benchmark's timeit() routine is significant, you're probably
measuring the wrong thing. But be that as it may, an alternative is to use
Time::HiRes. It has a short POD section that shows how to do exactly what
you want.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com