Eli Zaretskii wrote:
On Thu, 29 Mar 2001, Maurice Lombardi wrote:
What I'm wondering is, if DJGPP's libc contains a delay() function which does handle short delays well (and even seems to use microseconds internally AFAICS), why doesn't its usleep() function do the same thing?
If both functions used the same service, you couldn't have chosen one or the other, depending on your needs. Having both is better than only one.
Why is it a problem that they use different methods? The docs clearly says what service is used, so the information is available, isn't it?
The question has been raised by an user of GNU pascal (gpc) who found a difference between delay() in C and delay() in gpc. gpc beeing all platforms, not limited to djgpp, has implemented a delay() function by using usleep(), which, while being neither ANSI nor POSIX, is available on many platforms: prototype in unistd.h which exists e.g. on linux. The djgpp C delay() function is a dosish nicety (prototype in dos.h) which exists nowhere else. It is unfortunate that djgpp implemented the less accurate delay function with the more standard usleep() function. But probably gpc maintainers will cope with this ... Maurice