Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Leap second coming up. Check your date handling code (bad theory)

by RonW (Parson)
on Jan 04, 2017 at 23:22 UTC ( [id://1178967]=note: print w/replies, xml ) Need Help??


in reply to Re: Leap second coming up. Check your date handling code (bad theory)
in thread Leap second coming up. Check your date handling code

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.

Replies are listed 'Best First'.
Re^3: Leap second coming up. Check your date handling code (bad theory)
by perldigious (Priest) on Jan 05, 2017 at 14:11 UTC

    This post is glorious, and it made my day reading it because I'm laughing and thinking about all the stories like this my Electronics Engineer colleagues have told me over the years.

    Back when I was still a teen... Because I was curious... I setup a laser... I wired a circuit to a... computer... and to the modulation input of the laser... an optical receiver (I built)...

    The further I read the more I laughed and thought of this.

    Just another Perl hooker - Yes, I'll do really dirty code, but I charge extra.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-03-28 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found