Before alarm clocks existed, people used nails fixed onto candles
A candle clock is a thin candle with consistently spaced marking that when burned, indicate the passage of periods. While no longer used today, candle clocks provided an effective way to tell time indoors, at night, or on a cloudy day. A candle clock could be easily transformed into a timer by sticking a heavy nail into the candle at the mark indicating the desired interval. When the wax surrounding the nail melts, the nail clatters onto a plate below.
Before the alarm clocks existed, people used nails fixed on candles to wake up. They knew how to calculate the candle burning time and put the nail at the right time. As the candle melted, the nail fell, made noise and woke its owner.
It is unknown where and when candle clocks were first used. The earliest reference to their use occurs in a Chinese poem by You Jiangu (AD 520). Here, the graduated candle supplied a means of determining the time at night. Similar candles were used in Japan until the early 10th century.
You Jiangu's device consisted of six candles made from 72 pennyweights (24 grains each), of wax, each being 12 inches high, of uniform thickness, and divided into 12 sections each of one inch. Each candle burned away completely in four hours, making each marking 20 minutes. The candles were placed for protection inside cases made of a wooden frame with transparent horn panels on the sides. Similar methods of measuring time were used in medieval churches and earlier, famously by King Alfred the Great of England, first by counting the number of candles of a specific size burnt, and later by use of a graduated candle.