Introduction to the Science of Timekeeping

The concept of measuring time and the various engineering techniques that have evolved over time is well documented. Lot of time was spent in reading through various blogs, articles and publications to get substantial understanding in the domain of timekeeping and the Precision Time Protocol (IEEE 1588 standard). The intention of the blog is to summarise my study and help others who would venture in the same direction. Since, there are a lot of details I decided to break the story into two stories.

This article is the first in a 2-story series which describes the concept of timekeeping, history and evolution, some standard definitions and the various time protocols.

The only reason for time is so that everything doesn’t happen at once — Albert Einstein
Photo by Jon Tyson on Unsplash


For thousands of years, humans have adopted evolutionary techniques to sequence events. The origins of time is close to 6000 years old when the lunar trajectory guided humans to keep track of events. In the milleniums that followed, the idea of clock and calendar was invented and perfected in various forms pushing the boundary of Horology. From Sun-dials/obelisks, Ghatika yantra, Mayan calendar, Stonehenge, Mechanical water clocks, Pendulum clocks, Chronometer, Quartz clocks, Atomic clocks and Quantum clocks mankind has made giant leaps in understanding time and more accurate and efficient ways to measure it. One of the most famous quotes by great Albert Einstein underlining the importance of time is as “The only reason for time is so that everything doesn’t happen at once.”

Need for Advanced Timekeeping

With the advent of digitalisation in the last 70 years, the need for accurate measuring of fractions of a second, increased dramatically. The computer resources became cheaper, CPUs became faster and invention of high speed computer network ended the era of monolithic systems and gave rise to distributed systems. In a distributed setup, keeping the various clocks synchronous with high accuracy and precision is fundamental for the liveliness of the system and equally challenging. Accurate time is important to determining the order in which events occur and serves as a basic standard of transactional integrity, system and networkwide logging, auditing, troubleshooting and diagnostics. Mega science projects like the Large Hadron Collider (LHC), Large High Altitude Air Shower Observatory (LHAASO), Global Positioning System (GPS), International Thermo-nuclear Experimental Reactor (ITER), Laser Interferometer Gravitational-Wave Observatory (LIGO) base their complex experiments on very high precision, accuracy and synchronisation of the timing system. Even an error of a nanosecond can render the outcome of an experiment fruitless and cause substantial loss of effort and money (after all “Time is Money”).

Standard Definitions

Clock — A clock is a device with two parts: oscillator and counter. An oscillator provides equally-spaced periodic events while the counter accumulates the events to give time.

A clock

Second — A second is historically defined as 1/86400th part of a day. While the SI defined 1 second to be exactly 9,192,631,770 cycles of a Caesium 133 atomic clock.

Leap Second — A leap second is a one-second adjustment that is occasionally applied to civil time Coordinated Universal Time (UTC) to compensate for Earth’s rotation irregularities. Unlike leap years, there is no fixed pattern of introducing a leap second.

Figure 2. Leap Second Adjustments

Timescales — Time scale or Time standards are a specification of measuring time. Over the centuries time standards have been based on Earth’s rotation (Mean solar time, Sidereal time, Greenwich Mean Time — GMT), planetary motion calculations (Terrestrial time — TT, Ephemeris time — ET) and human constructed mechanisms (International Atomic Time — TAI, Universal time — Coordinated — UTC).

Timezones — A time zone is a region of the globe that observes a uniform standard time for legal, commercial, and social purposes. Theoretically, there are 24 time zones based on 24 longitudes that divide the Earth at a gap of 15o each and always 1 hour apart. However, for convenience and practicality there are almost 37 timezones in our world.

Clock Quality Factors

Working of a Computer clock

Working of a computer clock

A computer clock consists of a Timer Register and a (Advanced) Programmable Interrupt Controller (PIC/APIC) or a Programmable Timer Chip (PTC). The only job of PIC is to interrupt the CPU to update the Timer Register by adding one to the counter. The higher the number of bits in register, the better the resolution and range (64 bits = nanosecond resolution). The value added every timer interrupt is frequently referred to as “tick”. Time update frequency depends on the Interrupt Service Routine. Popular interrupt frequencies are 1024 Hz, 1MHz or even higher nowadays. The concept of “epoch” is used to define the zero. There is an additional Realtime (Hardware) Clock/CMOS Clock that keeps track of time when the system is off.

Time Protocols

As the need for high quality clocks increased, the science community introduced various technologies in the form of time protocols. The oldest and the most popular is the Network Time Protocol (NTP). Developed in 1985, this protocol works on the application layer of the network stack and uses UDP to synchronise the time of computers connected over the Internet. This protocol provides accuracy in millisecond and microsecond range over the Internet and local network, respectively. In a local network, having complex distributed system, NTP might fail to order the events as accurately as expected, leading to loss of system integrity. Therefore, over the years various other protocols have been invented to synchronise time with higher accuracy and precision in a network. Some of them are Precision Time Protocol (PTP), Datacenter Time Protocol (DTP), Global Positioning System (GPS) and White Rabbit Protocol (WR). Each one of these protocols can achieve sub-microsecond to sub-nanosecond level accuracy and precision and are used in most of the mega science projects listed above to satisfy the demands of stringent timing system.

This article is intended to get familiarized with the idea of timekeeping and the rich history it beholds. In another article, I will delve deep into understanding and applying the Precision Time Protocol (PTP) for an association with the mega science project named Thirty Meter Telescope (TMT).



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Puneet Patwari

I am a computer enthusiast with deep interests in computer science and technology. I love to read about space science and be an athlete in my free time.