A detent is a mechanical or magnetic means to resist or arrest the movement of a mechanical device. Such a device can be anything ranging from a simple metal pin to a machine. The term is also used for the method involved. Magnetic detents are most often used to divide a shaft rotation into discrete increments. Magnetic detents are inherent in some types of electric motors, most often stepper motors.