On 10/11/05, Jonas Maebe <[EMAIL PROTECTED]> 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
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to