Non-blocking alternative to pulseIn
Simple interrupt-based alternative to arduino's pulseIn function.