Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: RRD-Ping getting values on right interval

by quester (Vicar)
on Nov 30, 2011 at 08:46 UTC ( #940797=note: print w/replies, xml ) Need Help??


in reply to RRD-Ping getting values on right interval

Instead of "sleep 45" you can sleep until the start of the next minute with Time::HiRes:

use Time::HiRes qw{ time sleep }; ... my $now = time; sleep 60 - ( $now - 60 * int ( $now / 60 ) );

You might need to subtract a fraction of a second from the sleep interval if the log entries tend to end in :01 rather than :00.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://940797]
help
Chatterbox?
[ambrus]: Sometimes it's easier to just match elements in ways other than xpath, like directly with perl code.
[marto]: this is a cheap hack, a script that doesn't need to run for long, using WWW::Mechanize:: Firefox to drive some awful interface.
[marto]: if it were anything more serious I'd spend more time looking into it properly :P

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2016-12-08 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (140 votes). Check out past polls.