[fpc-pascal] Various Darwin problems

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Tue Oct 11 14:25:33 CEST 2005

On 10/11/05, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
> On 11 okt 2005, at 13:46, Marco van de Voort wrote:
> > The sleep was changed from select to nanosleep. It seems OS X
> > doesn't accept
> > sleeps smaller than 10ms.
> That is not true. This program takes half a second on my machine:

This only happens because you are getting a very big time period on
your test. Sleep, nanosleep and all other timing procedures are simply
*not* reliable when you want a microsecond or 1milisecond precision.
This kind of precision is achieved throught other means, such as
special device drivers, interruptions, real-mode, etc.

This happens for all protected-mode operating systems, but is worse on
linux due to the fair way the thread manager alocates time for each
task. On Windows this is not so bad because it doesn't distribute as
fairly the time.

This problem does not exist on real-mode OSes, such as DOS.

Take a look at: http://www.linuxjournal.com/article/0232

and: http://www.geisswerks.com/ryan/FAQS/timing.html

Felipe Monteiro de Carvalho

More information about the fpc-pascal mailing list