1. A motor control apparatus comprising: a driving control unit configured to control at least one of a rotating position and a rotating speed of a motor in accordance with a drive command based on an encoded signal, the encoded signal changing periodically in accordance with the rotating position of the motor; an interrupt control unit configured to start and execute interrupt processing for performing the driving control at an interrupt cycle; a first processing unit configured to execute first processing that detects the rotating position of the motor based on the encoded signal; and a second processing unit configured to select and execute second processing that outputs the drive command of the motor in accordance with the rotating position of the motor detected by the first processing unit, wherein the interrupt control unit is configured to execute the first processing before executing the second processing in the interrupt processing.