in reply to Re: time taken for prog to finish..
in thread time taken for prog to finish..

If you don't mind trading granularity for portability, you can make use of the magic variable $^T at the end of your script ...

END { printf "Took %d seconds to run.\n", time - $^T; }

    --k.


Replies are listed 'Best First'.
Re: Re: Re: time taken for prog to finish..
by agustina_s (Sexton) on Jan 25, 2002 at 14:31 UTC
    Hi... I have tried to put it in my prog:
    while(<>){ ..... } END { printf "Took %d seconds to run.\n", time - $^T; }
    Hm but when I compile it... it doesn't print out anything. I also try using the ";" after the last }. Thanks..