Before we head into the details of how the timer interrupts is utilized in our 1SJ device, let us first have a
better understanding of how it works generally in programs.
An "interrupt" interrupts the main program flow, calling a function that deals with an external problem or task.

For example, a CPU might be executing a main task.
Suddenly, a device/peripheral requests for a service using an interrupt.
The CPU has to decide whether to allow the interrupt based on its configuration and priority, since a higher priority interrupt can preempt a lower priority interrupt. If yes, it creates a snapshot, saving all program status on a stack and runs the interrupt processing program.
Once the interrupt is processed, the CPU restores the program state and resumes with the main task.