Interrupts and Timers

Do you need this to be a blocking function? That is it sits and waits until the input pin rises? Then just use pulseIn() or the NewPing library

The code you have seems to have no way to tell if the interrupt has happened. It just delays for thousands of milliseconds and then you may or may not have had an interrupt. There may have been several. Additionally, you re-attach the interrupt on every loop, which is wasteful, and you never zero out t1 for the next loop so you might be looking at the previous event, not the current one.

To do this with the highest possible resolution, you should be using the "input capture" mode of the timer. I have not successfully made this work myself, although I have tried. Look for some tutorials on input capture.