- #include <dos.h>
- #define TIMER 0x1c
- int timeCounter=0;
- int timeCounter1=0;
- int timeCounter2=0;
- void interrupt (*oldHandler)();
- void interrupt newHandler()
- {
- timeCounter++;
- timeCounter1++;
- timeCounter2++;
- oldHandler();
- }
- void setTimer(void interrupt (*p)())
- {
- oldHandler=getvect(TIMER);
- disable();
- setvect(TIMER,p);
- enable();
- }
- void killTimer()
- {
- disable();
- setvect(TIMER,oldHandler);
- enable();
- }