An engine speed sensor measures the rate at which the crankshaft spins by detecting interruptions in the magnetic field caused by notches on the crankshaft. It sends this speed information to the engine control module (ECM) which uses it to control ignition timing and other engine functions. There are two main types - magnetic sensors which generate an alternating current signal from a magnet, and Hall effect sensors which use blades to disrupt a magnetic field and produce an on/off signal read by the ECM.