54 const uint8_t sreg{ SREG };
57 const uint16_t low{ TCNT1 };
59 if ((TIFR1 & _BV(TOV1)) && low < 0x8000U)
68 return (
static_cast< uint32_t
>(high) << 16) | low;
volatile uint16_t overflows
uint32_t end()
The cycles since begin(), its own instructions included.
void start()
Starts a measurement (the first one also measures the overhead).
uint32_t stop()
The CPU cycles since start(), without those of start() and stop().
void begin()
Starts counting: from the last instruction on, one count per CPU cycle.