On 02/26/2015 11:33 AM, Henry Vermaak wrote:
Blocking with an even will sleep until someone wakes you up, it's very
efficient. Using sleep() you will have to wake up, check if someone
needs you, go to sleep again, etc. This is obviously more inefficient.
We were talking about the overhead of a "sleep for n milliseconds"
functionality itself, and not about waiting for some event.
Abusing it for polling of course is not what sleep is meant for.
Sleep is for granting the CPU for other processes for (at least) a
predefined time.
See the mail of the original poster: this is what he asked for.
-Michael
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal