Prior to starting or resuming execution of a task, the OS task scheduler would initialize a hardware timer to interrupt program execution after a defined period of time (e.g., 10ms). The scheduler then starts or resumes execution of the task. The processor proceeds to fetch and execute the instructions comprising the task for 10ms. When the hardware timer expires it generates an interrupt, causing the processor to suspend execution of the currently executing task and to switch to the OS's task scheduler. The OS determines which task to run next.