I understand that a single call to digitalPulse may have better accuracy between pulses.. but as the application will fire a pulse after another sensor decodes a pattern. The setInterval came from the test code I added to simulate the hardware.

The question now is if the original espruino does better than the ESP32 port.

Yes - the official boards use an IRQ-based timer. Just tried this on a Pico and it's exactly 2ms to as near as I can measure on my digital scope (so well within 1%)... And if that's not good enough there's some documentation on how to use the timer peripherals in the device itself.

There was a recent change in ESP8266 courtesy of @MaBe that fixed the issues that has, and it does look like the ESP32 is using IRQs so I'm not sure why there would be the variance.

Yes, but for something like digitalPulse there's one job queued up, so there is no real overhead involved.

Espruino's timer implementation could be improved (eg. for digitalPulse there's no need to use the current time at all), but it's reasonably low priority at the moment as it's quite a big change and it works fine on official boards. There's an issue for it here: https://github.com/espruino/Espruino/iss­ues/1444

If you really want accurate timing without actually buying an official board it's possible there's some spare timer hardware on ESP32 that you could set up yourself with peek and poke.

As a possible work around - you might be able to use the pwm output and do a setwatch on that - and in the setwatch- use that to drive another pin low then high and low again. You can use a variable flag to say if you want the out put in the output pin.