The oldest clocks were built in Egypt. Obeliks (3500 B.C) are the oldest clocks, whose moving shadows provided an easy way to follow the course of the day.
All the clocks work following a similar process, which consists of counting a regular cycle that allows us to measure the time. In other words, the measurement of the time consists of the comparison of a fixed event with another unknown event.
In ancient times, natural events were used as "datum point" for the measurement of time, for example the length of the day or the observation of the stars. The time measurement was not always destined to determine the hour of the day, sometimes this measurement just showed certain events that were interesting for our ancestors, like the solstices (stonehenge)
Other clocks used an own mechanism with a constant length instead of paying attention to an external event. The Egyptian about 1400 years B.C., developed the first instrument of this type, the clepsidra or water clock, which in its simplest form consisted of an alabaster bowl, wide at the top and narrow at the bottom, marked on the inside with horizontal "hour" marks. The Chinese or Hindues perfectioned this mechanism at a later stage. These clocks have continued to be used during centuries.
In addition to clepsidras, the Egyptians in the VIII century B.C used sun clocks, one of them is still conserved in Egypt.
Other civilizations used simple objects with ingenious forms to measure the time for example, the Chinese civilization burned a evenly tied cord and measured the time interval that the fire needed to travel from a knot to the following one.
The first mechanical clock was probably built around the 14th century, which was quite inexact albeit in many cases spectacular. However, the first references to this kind of clocks appeared in books of Alfonso X, although although later on great personages like Leonardo Da Vinci contributed to the development of ingenious apparatus which were more precise to measure the time. The first engine clocks were based on the use of weights. The invention of the wharf engine, in the XV century, permitted the development of portable clocks.
A further advancement came with the creation of the pendular clock, whose principle was conceived by Galileo, although was Huygens, a Dutch scientist, who built it in 1656. This clock supposed a great advance in respect of the previous ones, since it was out of phase just ten seconds a day. During the XVII century the first pocket clocks made their appearance. The pendulum clock was improved during almost three centuries, until 1929, when an American scientist, Warren A. Marrison,
developed the quartz-crystal clock, whose operation is based on the vibration that experiences the crystal when an alternating electric voltage is applied to it. A current quartz clock of extreme quality is out of phase a millisecond every month, if we consider an apparatus of less quality, this out of phase or even one greater will take place in few days. These are estimations in ideal conditions, nevertheless, the ageing of the crystal, the dirt and other agents can frequently harm the precision of these apparatuses.
In the middle of the last century, in 1949, the first atomic clock, based on the natural frequency of atomic particles was created, its precision was not much better than the one of the quartz clocks for the moment, nevertheless, eventually the use of other atoms have permitted the development of atomic clocks with extraordinary precission although the same protocol was followed to create it. The most common example is the Cesium atomic clock,
with an extraordinary exactitude (would approximately be out of phase a millisecond in 1400 years) The rubidium resonator, although of lower quality than the cesium resonator, is nevertheless important because it is relatively inexpensive compared to cesium resonators and is out of phase approximately a millisecond in several months which it is more than adequate for many of today's needs.