Date: Sat, 31 Mar 2001 03:29:22 +0200 From: Frank Heckenbach frank@g-n-u.de
So what's the advantage of the method used by usleep()?
It has both advantages and disadvantages.
Is it more accurate for longer delays, or doesn't the delay() method work on all kind of Dos / DPMI servers / whatever?
All of the above ;-)
The main advantage is that it uses the main system clock, not the one in CMOS which runs independently of the system. I also suspect that delay() might not work reliably on Windows.
Being no DJGPP expert, I'm wondering what we should call now in the GPC units.
I cannot advise here, since my Pascal knowledge is virtually non-existent. Do Pascal users really need sub-54ms resolution when they call these functions?
From what I see in the docs, a problem with delay() is that "some
operating systems that emulate DOS, such as OS/2 and Windows/NT, hang the DOS session when the @key{Pause} key is pressed during the call to @code{delay}."
Yes, that's one of the more notorious problems. But it isn't the only one.
I actually like the Int 15h services very much; it does a wonderful job on DOS. Unfortunately, it is not very reliable on Windows.
Does this mean we shouldn't call usleep() and just accept that short delays don't work, or should we just call delay() because MS-Windows users are used to random system crashes and hangs, anyway? ;-)
You could use delay() on plain DOS and usleep() on Windows and OS/2.