/* DEMO93.C Demonstration for use Timer functions to calculate functions will take how much time. functions: TimerOpen,TimerClose, StopWatchStart,StopWatchReadValue. kbhit() takes 0.5822 ms kbhit4() takes 0.0160 ms LedOn(),LedOff() takes 0.0077 ms ReadNVRAM() takes 0.1155 ms WriteNVRAM() takes 0.1186 ms ReadEEP() takes 0.3700 ms WriteEEP() takes 4.636 ms Show5DigitLed() takes 0.0663 ms FlashErase() takes 754.0 ms FlashWrite() takes 0.0411 ms */ #include #include #include"..\lib\7188.h" void main(void) { int i; unsigned long value; if(!Is7188()){ printf("\ndemo90.exe must run on I-7188"); return; } printf("\nPlease don't press anykey\n"); TimerOpen(); StopWatchStart(0); for(i=0;i<10000;i++){ kbhit(); } StopWatchReadValue(0,&value); printf("\nRun \"kbhit()\" 10000 times takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ kbhit4(); } StopWatchReadValue(0,&value); printf("\nRun \"kbhit4()\" 10000 times takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ LedOff(); LedOn(); } StopWatchReadValue(0,&value); printf("\nRun LedOn and LedOff 10000 times takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ ReadNVRAM(0); } StopWatchReadValue(0,&value); printf("\nRun ReadNVRAM 10000 times takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ WriteNVRAM(0,100); } StopWatchReadValue(0,&value); printf("\nRun WriteNVRAM 10000 times takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ ReadEEP(0,0); } StopWatchReadValue(0,&value); printf("\nRun ReadEEP 10000 times takes %lu ms",value); EnableEEP(); StopWatchStart(0); for(i=0;i<10000;i++){ WriteEEP(0,0,0); } StopWatchReadValue(0,&value); ProtectEEP(); printf("\nRun WriteEEP 10000 times takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ Show5DigitLed(5,5); } StopWatchReadValue(0,&value); printf("\nRun Show5DigitLed 10000 times takes %lu ms",value); StopWatchStart(0); FlashErase(0xD000); StopWatchReadValue(0,&value); printf("\nRun FlashErase 1 time takes %lu ms",value); StopWatchStart(0); for(i=0;i<10000;i++){ FlashWrite(0xD000,i,0xAA); } StopWatchReadValue(0,&value); printf("\nRun FlashWrite 10000 times takes %lu ms",value); while(kbhit4()) getch4(); TimerClose(); }