Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^2: Logical ways to calculate being within two times

by Anonymous Monk
on Nov 28, 2016 at 23:46 UTC ( #1176755=note: print w/replies, xml ) Need Help??

in reply to Re: Logical ways to calculate being within two times
in thread Logical ways to calculate being within two times

To guard against the infinite loop / leapsecond / 59 second minute

my $failsafe = 0; $time += 60 until localtime($time) =~ /$on_at:/ or $failsafe++ > +10_000;

Adjust the failsafe cutoff until its just large enough but not too large :) If it slows down this approach change it :) maybe use strptime

Replies are listed 'Best First'.
Re^3: Logical ways to calculate being within two times
by BrowserUk (Patriarch) on Nov 29, 2016 at 00:12 UTC

    That breaks the loop, but doesn't fix up the problem.

    Adding 30 instead of 60 prevents the problem completely and runs more quickly.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Just came across this article this morning. Google is, instead of doing the leap second, is going to slow their clocks on their NTP servers by 0.0014% over the 10 hours before and 10 hours after the leap second.

      Also, they've opened up these servers to the public.

      ps. I changed my code with the 30 second modification.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176755]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2022-01-27 15:20 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (70 votes). Check out past polls.