Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Back when I was still a teen, I worked (part time) for a small company that had to rely on dial-up modems for internet service. Synchronizing time between the office and the factory (several miles apart) had to be done using WWV radios. We had a simple program (in C) that compared the result of gmtime(time(NULL)) with the time string from the WWV radio, then used adjtime() to "nudge" the system clock as needed.

When a leap second occurred, this "smeared" the extra (or missing) second over the next several minutes, resulting in a gentle transition. (On system boot, though, the time was simply set.)

Within each building, the computers were able to sync to the building's "master" time keeper over Ethernet.

Because I was curious - and the office was on a high enough floor to be able to see the factory buildings - I setup a laser and aimed it at the window of a room in one of the factory buildings. I wired a circuit to a serial port on a computer in the office and to the modulation input of the laser. Then I went to the factory and plugged an optical receiver (I built) into a serial port on a computer, there. Then I ran a shell script to alternately read/display a line from the serial and run the date command. The time on both computers was definitely within 1 second of each other. Probably within .1 second.


In reply to Re^2: Leap second coming up. Check your date handling code (bad theory) by RonW
in thread Leap second coming up. Check your date handling code by 1nickt

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: (6)
As of 2024-04-19 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found