How is a crankshaft position sensor used to monitor misfiring?

by sensing engine RPM it can teel if engine is not running smooth by sensing the rotation of the rpm's of the engine.