What does it mean "To derive timestamp from a time server."?

189 views Asked by At

Context

I'm learning how to use Google's - GTFS-realtime

The timestamps that are supplied by a service adhering to this standard are described on this page: https://developers.google.com/transit/gtfs-realtime/reference

Part of the instructions include this sentence:

"To avoid time skew between systems producing and consuming realtime information it is strongly advised to derive timestamp from a time server."

Steps Taken To Understand

  1. I looked over the wikipedia page on time servers - http://en.wikipedia.org/wiki/Time_server

Question

  1. Can someone clarify what this instruction means in practical terms?
3

There are 3 answers

0
keenthinker On BEST ANSWER

Suppose that your application is running on multiple machines. Some event occurs concurrently (at the same time) on two or more machines. If the machines time is not synchronous (machine 1 says 01.09.2013 08:00:00.000 and machine 2 says 01.09.2013 07:58:45.123). The events will not have the correct appearence in your log (or display, or whatever)!

If you ask a time server for the timestamp, then both events will have the same timestamp respectively all events (no matter on which machine) will have the timestamp from the same source! Timestamp could be important (event order, priority, and so on).

0
Ido Sarig On

In practical terms, what this means is whenever you want to get a timestamp for use in your application, instead of using your own copmauter's timesatmp, you should get it from a time server on the network. To set this up , you can read this: http://www.pool.ntp.org/en/use.html

0
usr On

You ask the server what time it is, because your local hardware clock might be inaccurate. For some algorithms it is important that time is synchronized.

Even if it is not a strict requirement, synchronous clocks are helpful for debugging. You need to correlate logs sometimes.