It will depend on the clock rate of the board you use. A 16MHz clock will let the hardware quantize pulse widths of 0.0625us. Read their datasheets and find out what their timers can do for you. You don't want to measure this in software. The $4USB Raspberry Pi Pico has a 125MHz clock, and could get you 8ns resolution.
Answer from aMike on Stack OverflowReturn time in Nanoseconds
Nanosecond time measurement with Arduino due
Are we able to get nanosecond function or handle under nanoseconds in Arduino Due
Any cheap way to measure times down to nanosecond accuracy?
The smallest time interval you can measure using the Arduino Due's built-in hardware is roughly 23.8 nanoseconds.
The smallest time interval you can measure using the Arduino Uno's built-in hardware is roughly 62.5 nanoseconds.
Arduino Due timers
The Arduino Due uses an Atmel SAM3X8E microprocessor. It has 3 identical Timer-Counter peripherals, each of which has 3 independent timer channels. On the Due, these are the best way to measure small amounts of time if you want resolution in nanoseconds. Each Timer-Counter can use different clock sources as input - these determine the increments of time the Timer-Counter can measure. The fastest clock source is MCK/2, the master (system) clock divided by 2.
On the Arduino Due, MCK is 84MHz.
This means that the smallest interval of time the Timer-Counter can measure is 2 / 84,000,000, or about 23.8 ns.
You can read more about the SAM3X8E Timer-Counters in the SAM3X8E reference manual, section 37, page 868.
Here's an Open Source library that provides a nice API to the Arduino Due's Timer-Counters. Here's a pretty clear explanation of how the SAM3X8E timers work, an alternative to reading the SAM3X8E reference manual.
You can also write ARM assembly code to measure durations in nanoseconds, but the Timer-Counters will probably have higher resolution.
Arduino Uno timers
The Arduino Uno uses the Atmega328 microprocessor. It has two Timer/Counters which can use different clock sources as input - the fastest source is FCLK_I/O (system clock, 16MHz). This means the smallest interval it can measure is 1 / 16,000,000 seconds or 62.5 nanoseconds.
You can read more about the timers in the AVR datasheet, Section 16, page 141. Or check out this summary of how to use the AVR native timers.
Arduino Uno/Nano micros() function (4us resolution), and my replacement function with 0.5us resolution:
I can't answer the question about the precision of the core Arduino micros() function when used on a Due. However, I wanted to present my work on the Arduinos using the Atmega328 microcontroller (such as the Uno, Nano, Ethernet, etc), as it may be helpful to others too.
Here it is: "I wrote a "libary" to get 0.5us precision on a "micros()" replacement function, so that I can get repeatable results reading a PWM or PPM signal, to within 1us. I searched all around the internet and could not find something comparable (or that was easy to use, and maintained the Arduino's ability to write PWM signals via the Servo Libary), so I think this is my first real contribution to the world of Arduino and Radio Control."
The code is downloadable here: http://electricrcaircraftguy.blogspot.com/2014/02/Timer2Counter-more-precise-Arduino-micros-function.html
Hi, I'm working on my final year project which is really time sensitive. I need to be able to measure time stamps as precise as the nano second region. This is because my project is looking to track distances using RF signals. I'm using a Time of Arrival localisation scheme and so I'd need time of flight and speed of the waves.
By my calculations, to get an accuracy of around 30m I'd need time stamps as accurate as 100ns. So far I've been using micros() to get these timings but they're obviously not accurate enough.
Using an arduino uno clocked at 16MHz, id expect it be able to measure this, however I don't know how to do this.
I've made peace with the fact that I probably won't be able to get it done in time, however I am still curious if it is at all possible.