Thomas Jakub wrote:
> 
> How can I tell how much time a program has been
> running for in a perl script?  I tried to do $time01 =
> localtime() and $time02 = localtime() and then
> subtract $time01 from $time02, but I always get zero,
> even though there was about five or so minutes of
> activity in between the parts where $time01 was
> defined and $time02 was defined.  My guess is that it
> is not copying the variable over, but the memory
> location, and since the variable within that memory
> location is changing, both are changing, but this is
> all just a guess...
> So, does anyone know how I can tell how much time a
> program has elapsed in perl?

it's not working because you're trying to subtract two non-numeric
values, which always results in 0.

you may want to check out this module on cpan:

http://search.cpan.org/search?dist=Devel-Timer

it sounds like it does pretty much exactly what you want.

Reply via email to