But an interrupt takes almost no time away from your main sketch. pulseIn() is blocking so your sketch is locked up and unable to do anything else for up to 2 seconds at a time.
But an interrupt takes almost no time away from your main sketch. pulseIn() is blocking so your sketch is locked up and unable to do anything else for up to 2 seconds at a time.