The arduino pulseIn function also includes delays.