Mail Archives: djgpp/1996/12/15/15:53:10
Hi,
The delay() declared at dos.h does not work very well on the following
codes,
#include <dos.h>
#include <iostream.h>
void main()
{
int count=0;
for(;;)
{
delay(1);
cout << ++count << "\r"; cout.flush();
}
}
At the beginning, the number change very quickly (this is normal, since delay
1/1000 sec per count). However, after running this code for a while (about
30 sec), the counting rate slow down a lot (looks like delay(1) will delay
1/5 sec). After this happened, the delay() never run normally anymore.
I must reboot the system to get the correct delay() rate for about 30 sec
and then it slow down again. Does anyone have similar behavior??? What's
wrong here??? Thanks a lot.
Kuang-chun Cheng
kccheng AT hep2 DOT phys DOT sinica DOT edu DOT tw
- Raw text -