Timer problem on STM32F7 - erratic behavior
You're going about this all wrong.
There is no possible way that you're going to be able to execute your timer interrupt handler in just 16 clock cycles - nevermind get around to your while(1) loop.  

What you should be doing is letting timer run free and only handle interrupts when it overflows. We'll get back to this soon.  

Next, set up an interrupt handler for your EXTI and in it, capture the value of the timer &amp; save it.
In the next interrupt, calculate the difference between the 2 values - and there you have it - the time between 2 successive EXTI events in multiples of your timer period (1uSec if you keep it set up the same).  

But what if the timer rolls over - well that's why we want to handle timer interrupts on rollover.
Here you can set a flag to tell your EXTI handler that the timer has rolled over and it needs to take that into account when doing the calculation.