ESP - measure time between two inputs in high speed

I have a ESP32, and have 4 digital signals. At the beginning all 4 are low, and as soon as any one of those goes high, the other 3 follow up. I would need to measure the time between the first one and the other three.. The problem is that the time delta is very small. The other input should be high between 0.0003 ms and 0.023 ms. I am trying to measure the time sound takes to travel inside a 15 cm steel plate (about 3150m/s).

Is there any way (also with cheap external components) to measure such tiny intervals?

• How much resolution/accuracy do you require? May 25, 2021 at 11:17
• @DaveTweed at least 1mm, hence the 0.0003ms.. May 25, 2021 at 11:24
• 300ns. The RMT module should be able to do that easily. May 25, 2021 at 11:26
• thank you, should I keep polling the inputs and measure the time? or how would it be done with the RMT module? May 25, 2021 at 11:37
• @sharkyenergy By my computations, $\frac{15 \:\text{cm}}{3150 \frac{\text{m}}{\text{s}}}\approx 48\:\mu\text{s}$. And $1\:\text{mm}$ resolution does say about $320\:\text{ns}$. Which I'd cut in half to create a design goal. So I'd use $150\:\text{ns}$. In addition, digital inputs to any MCU have a sampling uncertainty to them, relative to clocking. I'd be zeroed in on the specs there. (Haven't looked. Just putting it on top of the table in plain view.) Anyone disagree so far?
– jonk
May 25, 2021 at 16:37