Measuring clock cycles