There's more than one way to do things | |
PerlMonks |
Re^2: The most precise second (timer)by tukusejssirs (Beadle) |
on Nov 27, 2019 at 13:57 UTC ( [id://11109310]=note: print w/replies, xml ) | Need Help?? |
haukex, you’re the closest to understanding my problem and possibly to give me a solution! Well, on the chronyd stuff: I am running chronyd service, but not running ntpd (which is not even installed on particular system), see bellow.
I still need to delve into the chronyd docs. Is this interpretation of your problem correct? Well, kind of. We’d like to monitor some stuff each and every second. In the perfect world, this would mean that each and every real second a script would run, get data and insert in into the DB. As we don’t want/need to use atomic clock (etc), therefore by the real second we mean a second as So if sleep is not the right tool for the job, what would it be? And why does the EV (my $w2 = EV::periodic( 0, 1, 0, sub { print Math::BigFloat->new( sprintf("%d.%06d",gettimeofday) ), "\n";} );) seconds diff is greater than the original code (below is simplified version of the original code; on my computer it has diff bellow 0.0004, sometimes the avg is 0.0002)?
In Section
Seekers of Perl Wisdom
|
|