Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: RRD-Ping getting values on right intervalby CountZero (Bishop) |
on Nov 30, 2011 at 09:14 UTC ( [id://940801]=note: print w/replies, xml ) | Need Help?? |
On the average you will get half a second "error" on each sleep and all other processes running will add a slight delay too. So that adds up in the end. Rather than rely on sleep 45 you better sleep for 40 seconds and then start polling the internal clock and launch your pings on the dot of the next minute. You will get re-synchronised that way every time and your errors will be minimal. CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In Section
Seekers of Perl Wisdom
|
|