pulseIn() does not appear to be supported on the nano 33 ble. what alternatives are there?
how about a hardware solution?
The nRF52840 has timers with capture function. You might need to do some datasheet reading and write your own functions and/or some google to find a ready solution.
Maybe this helps you get started: