Time Synchronization in Layman’s Terms

This morning I was preparing a breakfast for myself, and blogging was not in my plans. But as the saying goes, “If you want to make God laugh tell him about your plans”.

The time difference in internal clocks between the client and the remote server computer is a well known issue that software developers have to deal with in the real-time applications.

Consider traders placing orders to purchase stocks or currencies. The number of transactions per second is huge and the prices are rapidly changing. If a trader placed an order to buy 100 shares of MSFT at 10:25:33AM this doesn’t mean that the server will mark this transaction with exactly the same time. I’m not even talking about network congestions and latency issues. The issue can be caused by a simple reason – the clocks in the client and server computers are off by a second or two. Some time ago we had to send a special ping on the protocol level to calculate the difference in times.

Why do I write about it on Sunday morning when stock exchanges are closed? I was boiling eggs for breakfast. My wife always compliments me on how can I always guess the time needed to prepare soft boiled eggs. The secret is simple – just keep the eggs boiling for 5 minutes. That’s all there is to it.

When I dropped the eggs into the boiling water the microwave clock showed 9:53AM. Then I started working on my notebook, and when I checked the time again it was 9:57AM. Strange. It feels a little too soon. Time flies. But then I realized that it was my notebook clock that showed me 9:57AM, while the microwave displayed 9:55AM. The time synchronization issue in action!

The lesson learned: when you boil eggs check the time using the same clock to avoid time synchronization issues and overcooking eggs. This will make your spouse happy too. Enjoy the rest of your Sunday!

Advertisement

4 thoughts on “Time Synchronization in Layman’s Terms

  1. That’s why I start to wear a wrist watch to have just one canonical place that I’d forget to check 🙂

  2. It’s about time microwave ovens and other appliances sync with an atomic clock via radio signal reception. There are plenty of $10 alarm clocks already doing this. Place one on top of your microwave.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s