/****************************************/ /* Bk_Delay */ /* Delay with optional key-press break */ /* */ /* bk_delay(unsigned int msec); */ /****************************************/ #include #include #include bk_delay(unsigned int msec) { unsigned long t0, t; t0 = (unsigned long)clock() * 1000L / 18L; do { t = (unsigned long)clock() * 1000L / 18L; if((t - t0) >= (unsigned long)msec) break; } while(! kbhit()); if(kbhit()) getch(); } .