in reply to Timing Your Program
You might look at Time::HiRes which implements hi resolution versions of time, alarm and sleep. Get and store the time of day in floating seconds (or seconds and microseconds) at whatever parts of your script it makes sense to watch. At the end, use the supplied tv_interval subroutine to compute the differences between two fractional times. I use this in conjunction with Apache::Scoreboard to do some near real-time monitoring of high traffic web servers, attempting to subtract the time it takes to execute commands and receive scoreboard information from a fixed interval so that the timing and calculations are more accurate. It works well.
|