Escapement

Pink gravity pendulum performs a harmonic angular oscillation.
Green ratchet wheel tends to rotate clockwise due to blue weight.
The pink anchor allows the wheel rotate only two teeth during one oscillation of the pendulum.
Tick-tock sound is caused when the anchor collides the wheel teeth.
The mechanism is used in pendulum clocks where the wheel motion is transmitted to hands through a gear train to show time.
Besides the wheel transfers energy to the pendulum (timekeeper) to replace the energy lost to friction during its cycle and keep the timekeeper oscillating.