A set of mathematical equations can help turn apparently random observations into a clock – and then measure its accuracy