control rpm of a motor

i though of 5-10 seconds. Can I do it with a Timer Interrupt?