Shawn H Corey wrote:
On Sun, 15 Sep 2013 13:00:36 -0700
Unknown User<knowsuperunkn...@gmail.com> wrote:
If my perl script has a sleep for say 300 seconds, when the sleep is
being run is there any way i can find the time remaining in the sleep
say by sending a signal?
Thanks,
Not directly. You have to record the time before the sleep and then you
can measure how long the sleep lasted.
my $started_sleep = time;
sleep 300;
my $time_asleep = time - $started_sleep;
Or just:
my $time_asleep = sleep 300;
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/