RDTSC alternative for Arduino
There are several alternatives. The best choice for you depends on the
time resolution you need and the maximum duration you may want to
measure:


millis() is good for slow things. It has a resolution of 2&nbsp;ms
(it increments by steps of 1&nbsp;ms most of the time, but 2&nbsp;ms
occasionally) and can measure durations as long as 49.7&nbsp;days.
micros() is the easy choice for when you want more resolution for
faster things. It increments in steps of 4&nbsp;µs and is limited to
about 71.6&nbsp;minutes.
For very fast things, you can get single-cycle resolution if you
configure Timer&nbsp;1 to count at the full CPU speed, assuming you
don't need the timer for something else. But beware the timer will
roll over roughly every 4.1&nbsp;milliseconds.
You could also use Timer&nbsp;1 with the prescaler set at ÷8 in order
to expand the measurable range to 32.8&nbsp;ms, at the cost of a
degraded resolution.


Here is a table summing up the available methods, sorted by resolution:

method        data type  resolution  max. duration
--------------------------------------------------
millis()       uint32_t        2 ms     49.7 days
micros()       uint32_t        4 µs     71.6 min
Timer 1 (÷8)   uint16_t      0.5 µs     32.8 ms
Timer 1 (÷1)   uint16_t     62.5 ns      4.1 ms