Date: Mon, 24 Nov 1997 19:21:54 +0200 (IST) From: Eli Zaretskii To: Fabrice ILPONSE cc: djgpp users group Subject: Re: djgpp slow (source files) In-Reply-To: <34795F4D.599A@trash.lip6.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 24 Nov 1997, Fabrice ILPONSE wrote: > main() > {Vmem *u; > int a; > XON(320,200); > > do { Color(0,0,30,0); > Xtest(); > Color(0,0,0,0); > WaitVBL(); > if (kbhit()) a=getch(); else a=0; > } while (a!=27); > > return 0; > } You are calling `kbhit' inside the loop. A call to `kbhit' requires a mode switch (it boils down to a call to the BIOS Int 16h function), which is much slower from protected mode. If the `kbhit' call is just a means to break out of the loop, then I suggest replacing it with a SIGINT handler. Then pressing Ctrl-C will cause the loop to be exited. That should be much faster.