Page 1 of 1

Question about "Delay"

Posted: Thu Mar 06, 2025 9:11 am
by Caronte3D
I know how to use Delay(time) to pause the program so not to eat all the processor cycles, but...
What is the function of Delay(0)?

Re: Question about "Delay"

Posted: Thu Mar 06, 2025 10:27 am
by Fred
It does a yield, a explained here: https://learn.microsoft.com/en-us/windo ... hapi-sleep
A value of zero causes the thread to relinquish the remainder of its time slice to any other thread that is ready to run. If there are no other threads ready to run, the function returns immediately, and the thread continues execution.

Re: Question about "Delay"

Posted: Thu Mar 06, 2025 10:31 am
by Caronte3D
Thanks! :wink:

Re: Question about "Delay"

Posted: Thu Mar 06, 2025 10:58 am
by Skipper
Is this behaviour identical on all platforms?