Abbacabba has asked for the wisdom of the Perl Monks concerning the following question:
The only thing I see here is that I might end up sleeping for $Interval + 59 seconds, which is fine with me. Does anyone feel uneasy about this code?my $slept; my $Interval = 120; while(1) { check_signals(); $slept = 0; while($slept <= $Interval) { $slept += sleep(60); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tracking actual time spent sleeping: Is this bad coding?
by dragonchild (Archbishop) on Feb 02, 2005 at 15:12 UTC | |
by Random_Walk (Prior) on Feb 02, 2005 at 15:21 UTC | |
by friedo (Prior) on Feb 02, 2005 at 15:25 UTC | |
by jpk236 (Monk) on Feb 02, 2005 at 15:36 UTC | |
by Random_Walk (Prior) on Feb 02, 2005 at 15:52 UTC | |
by vek (Prior) on Feb 02, 2005 at 16:54 UTC |