The history of timekeeping devices dates back to when ancient civilizations first observed astronomical bodies as they moved across the sky. Devices and methods for keeping time have gradually improved through a series of new inventions, starting with measuring time by continuous processes, such as the flow of liquid in water clocks, to mechanical clocks, and eventually repetitive, oscillatory processes, such as the swing of pendulums. Oscillating timekeepers are used in modern timepieces.
Sundials and water clocks were first used in ancient Egypt c. 1200 BC (or equally acceptable BCE) and later by the Babylonians, the Greeks and the Chinese. Incense clocks were being used in China by the 6th century. In the medieval period, Islamic water clocks were unrivalled in their sophistication until the mid-14th century. The hourglass, invented in Europe, was one of the few reliable methods of measuring time at sea.
In medieval Europe, purely mechanical clocks were developed after the invention of the bell-striking alarm, used to signal the correct time to ring monastic bells. The weight-driven mechanical clock controlled by the action of a verge and foliot was a synthesis of earlier ideas from European and Islamic science. Mechanical clocks were a major breakthrough, one notably designed and built by Henry de Vick in c. 1360, which established basic clock design for the next 300 years. Minor developments were added, such as the invention of the mainspring in the early 15th century, which allowed small clocks to be built for the first time.
The next major improvement in clock building, from the 17th century, was the discovery that clocks could be controlled by harmonic oscillators. Leonardo da Vinci had produced the earliest known drawings of a pendulum in 1493–1494, and in 1582 Galileo Galilei had investigated the regular swing of the pendulum, discovering that frequency was only dependent on length, not weight. The pendulum clock, designed and built by Dutch polymath Christiaan Huygens in 1656, was so much more accurate than other kinds of mechanical timekeepers that few verge and foliot mechanisms have survived. Other innovations in timekeeping during this period include inventions for striking clocks, the repeating clock and the deadbeat escapement.
Error factors in early pendulum clocks included temperature variation, a problem tackled during the 18th century by the English clockmakers John Harrison and George Graham. Following the Scilly naval disaster of 1707, after which governments offered a prize to anyone who could discover a way to determine longitude, Harrison built a succession of accurate timepieces, introducing the term chronometer. The electric clock, invented in 1840, was used to control the most accurate pendulum clocks until the 1940s, when quartz timers became the basis for the precise measurement of time and frequency.
The wristwatch, which had been recognised as a valuable military tool during the Boer War, became popular after World War I, in variations including non-magnetic, battery-driven, and solar powered, with quartz, transistors and plastic parts all introduced. Since the early 2010s, smartphones and smartwatches have become the most common timekeeping devices.
The most accurate timekeeping devices in practical use today are atomic clocks, which can be accurate to a few billionths of a second per year and are used to calibrate other clocks and timekeeping instruments.