On 5/1/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:

On Mon, 2006-01-05 at 16:28 -0700, Anthony Ettinger wrote:
> I'm tracking execution time of a bunch of scripts, and want to drop in
> "tracker.pl" into each script...the problem I'm faced with is if a
> user walks away from their computer while the script is waiting for
> input from STDIN.

You cannot time any script (or any part of a script) that uses IO. No,
you can't. Sorry, I heard that argument before and you still can't time
it.

OK, IO is dependant on things outside of the computer. Yes, I know the
hard disk is built-in and is inseparable while the machine is running,
but it's speed is dependant on other programs that may be running at the
same time. That means, they could be slowing down your program.

So, now tell us what you want to achieve. Show us the code that "is
slow" and maybe we can tell you how to speed things up. And if you can't
separate the code from the IO, then what do you expect from us?


--
__END__




I'm not trying to benchmark, just gather some real-world data in my tools.

Basically, I set $start_time = time();, subtract out time waiting during
user input, and take the difference of $end_time = time();

Whether this is a good way of gather the data is beyond the question...I'm
curious if there's a way to trigger a pause/unpause routine automatically
from my library when <STDIN> is used.

Reply via email to