/* DEMO90.c Demonstration for use Timer function used:TimerOpen,TimerClose,TimerReadValue,TimerResetValue. Max TimerValue=0xFFFFFFFF=4294967295(ms)-->4294967.295(S)-->49.7(days) */ #include #include"..\lib\7188.h" void main(void) { unsigned long time,sec; unsigned sec1; int quit=0; printf("\nPress any key to start timer"); printf("\nthen Press '0' to Reset timer,'q' to quit\n"); getch4(); TimerOpen(); while(!quit){ if(kbhit4()){ switch(getch4()){ case '0': TimerResetValue(); break; case 'q': quit=1; break; } } time=TimerReadValue(); sec=time/1000; sec1=time%1000; printf("\rTime=%05ld.%03d sec",sec,sec1); } TimerClose(); }