In microcontroller based compilers there is a provision for using interrupts when timer0 overflows or timer1 overflows.

The syntax is,
void time_func(void) interrupt 1 using 1
{
:
BODY OF THE...