Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $duration = 1000000; # in seconds my $wait = $duration; while ($wait >= 0) { $cmd1; $cmd2; $cmd3; $wait = $duration-time;#Decrement the time till it executed $cmd3 wi +th $duration }
In the above code, i want to execute the while loop for $duration seconds. Once it reaches $duration while should break. Sleep won't help here , neither the time . Is there a way to acheive this
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: timer in perl
by haukex (Archbishop) on Feb 20, 2018 at 10:57 UTC | |
|
Re: timer in perl
by hippo (Archbishop) on Feb 20, 2018 at 11:10 UTC | |
|
Re: timer in perl
by LanX (Saint) on Feb 20, 2018 at 10:59 UTC | |
|
Re: timer in perl
by thanos1983 (Parson) on Feb 20, 2018 at 11:57 UTC | |
|
Re: timer in perl
by karlgoethebier (Abbot) on Feb 20, 2018 at 16:59 UTC | |
|
Re: timer in perl
by clueless newbie (Curate) on Feb 20, 2018 at 13:56 UTC | |
|
Re: timer in perl
by Anonymous Monk on Feb 20, 2018 at 16:53 UTC |