in reply to Current time as variable?

What's wrong with
$time1 = time;
?

If that's too coarse for you, you can try using Time::HiRes:

use Time::HiRes 'time'; $time1 = time; sleep 2; $time2 = time; printf "Time difference = %.2f seconds\n", $time2-$time1;

Replies are listed 'Best First'.
Re: Re: Current time as variable?
by Art_XIV (Hermit) on Dec 10, 2003 at 19:44 UTC

    More on time:

    The time function gives you the number of seconds that passed since Jan 1, 1970. The number of seconds since 1/1/70 are also known as 'epoch seconds'.

    time is quite suitable/simple for calculating the passage of seconds.

    Hanlon's Razor - "Never attribute to malice that which can be adequately explained by stupidity"