No spark after the engine stall till it cools down in 10 to 20 minute. on 2001 Mazda Protege

After driving for 20 miles the engine stall. When I check for spark on the spark plug there is non. But the spark comes back after 10 to 20 minutes. What could me the problem?

Asked by for the 2001 Mazda Protege
you probably have a bad distributor
Replace crankshaft sensor!!!!!!!