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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You should be very wary of the first second of any sleep() call - as per the POSIX spec, this is allowed, and frequently is, somewhere between 0 and 1 seconds (being based on when the computers clock counds the end of a second. So whether your clock currently says 12:00:00.01 or 12:00:00.99, if you ask it to sleep 5, it will finish at 12:00:05.00 This is obviously less of a problem if you're asking it to sleep to just delay between two actions, but if you're using it to issue metronome clicks, then you get strange issues depending on how long it takes to do the processing between the sections.

Getting back to the main question, I read the issue as being more about changing to summertime, rather than clock corrections. (probably because the clocks only changed recently) But either way it sounds like your sysadmin needs educating - for time correcting, use NTP as suggested. For summertime, the system clock itself shouldn't be changed, but users can have their timezones changed to match their requirements. Meanwhile, your script can set its timezone to something fixed ($ENV{'TZ'} = 'UTC' is my preference) and then it won't be bothered by daylight saving.

the hatter


In reply to Re: Re: system-clock-safe timers without time()? by hatter
in thread system-clock-safe timers without time()? by edan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found