Since clocks must run continuously, there is often a small secondary power source to keep the clock going temporarily during interruptions in the main power
In old mechanical clocks, a maintaining power spring kept the clock turning while the mainspring was being wound
In quartz clocks that use AC power, a small backup battery is often included to keep the clock running if it is unplugged temporarily from the wall.
The timekeeping element in every modern clock is a harmonic oscillator, a physical object (resonator) that vibrates or oscillates repetitively at a precisely constant frequency.
In mechanical clocks, this is either a pendulum or a balance wheel.
In some early electronic clocks and watches such as the Accutron, it is a tuning fork.
In quartz clocks and watches, it is a quartz crystal.
In atomic clocks, it is the vibration of electrons in atoms as they emit microwaves.
In early mechanical clocks before 1657, it was a crude balance wheel or foliot which was not a harmonic oscillator because it lacked a balance spring
As a result they were very inaccurate, with errors of perhaps an hour a day.
The advantage of a harmonic oscillator over other forms of oscillator is that it employs resonance to vibrate at a precise natural resonant frequency or 'beat' dependent only on its physical characteristics, and resists vibrating at other rates
The possible precision achievable by a harmonic oscillator is measured by a parameter called its Q, or quality factor, which increases (other things being equal) with its resonant frequency. This is why there has been a long term trend toward higher frequency oscillators in clocks
Balance wheels and pendulums always include a means of adjusting the rate of the timepiece
Quartz timepieces sometimes include a rate screw that adjusts a capacitor for that purpose
Atomic clocks are primary standards, and their rate cannot be adjusted.
Synchronized or slave clocks
Some clocks rely for their accuracy on an external oscillator; that is, they are automatically synchronized to a more accurate clock:
Slave clocks, used in large institutions and schools from the 1860s to the 1970s, kept time with a pendulum, but were wired to a master clock in the building, and periodically received a signal to synchronize them with the master, often on the hour. Later versions without pendulums were triggered by a pulse from the master clock and certain sequences used to force rapid synchronization following a power failure.
Synchronous electric clocks don't have an internal oscillator, but rely on the 50 or 60 Hz oscillation of the AC power line, which is synchronized by the utility to a precision oscillator
This drives a synchronous motor in the clock which rotates once for every cycle of the line voltage, and drives the gear train.