Controlling a DC motor for a certain amount of time