Measuring time in astronomy