Before clocks were invented, candles that burnt a set amount of time were used as clocks. In order to set an alarm, plug a nail into the wax candle at the desired length time, when that candle reached the nail after melting, the nail would fall down on the metal clank and the noise would wake you up! Brilliant!