1999 Honda Civic doesn't start after it gets to temperature

My car sometimes doesn’t start. Mostly after it’s up to temperature. It cranks and cranks and cranks but doesn’t turn over. As soon as a call a tow truck, it starts right up.

Maybe crankshaft position sensor, maybe fuel pump, maybe an ignition relay underhood. All can cause an intermittent no-start because of temperature. It needs to be tested for fuel pressure and spark and power to the ignition when this happens. Maybe a trip to the mechanic will trigger the no-start?

The relay and sensor are both cheap and I’d just replace them anyway on a 19 year old car. If the car has over 130K miles or so and never had a pump replaced, I’d do that too, whatever you find.