Is this at random speeds? Only when coming to a stop? Devil is in the details.
If your engine computer loses the crankshaft position sensor signal, it can kill the engine momentarily, then sometimes it catches itself and continues to run.
A flaky ignition coil can do this too for that matter, but crank sensor failure in this mode is more common.
Crankshaft Position Sensor: (CPS/CKP) Failure Symptoms / Testing
*Both the fuel gauge and or voltage gauge may not work/display
*It is possible that you may see a No Bus on the odometer (on newer models only)
*You will have no spark. Fuel pressure may check out okay at the fuel rail, but fuel won’t get to the fuel injectors
*For 96 + newer, sometimes the OBDII code reader has trouble connecting to /reading codes. Crankshaft position sensor failure may or may not result in a check engine light/fault code.
*Crankshaft position sensors can be intermittent resulting in an abrupt misfire.
"Thermal failure" is common. Thermal fail means that the sensor fails when engine gets hot, but works again when engine cools down. Be aware of this when testing, as if you have a sensor that suffers from thermal failure, it’s possible that it may test GOOD as soon as it cools down.
*Don’t get tunnel vision and assume the sensor is bad (unless it checks out as bad with a meter) Damaged wiring or a dirty connector can inhibit the signal from making it to the computer. Check/clean/repair as necessary.
------------------------------------------------------------------------------------------------
CRANKSHAFT SENSOR TESTING PROCEDURE: 1991 – 2001 4.0L H.O. engines
1. Near the rear of intake manifold, disconnect sensor pigtail harness connector from main wiring harness.
2. Place an ohmmeter across terminals B and C. The terminals are identified as A-B-C looking into connector from left to right with the "notch" in the middle of the connector on your right. Ohmmeter should be set to 1K-to-10K scale for this test.
3. The meter reading should be open (infinite resistance). Replace sensor if LOW RESISTANCE