dabestprogrammerindauniverse
asked on
Sleep method
what is the effect of the Sleep method in delphi? is it safe to use? thanks in advance!
there are also other waiting methods
SleepEx, WaitForSingleObject, WaitForMultipleObcects
read about them in help :)
SleepEx, WaitForSingleObject, WaitForMultipleObcects
read about them in help :)
Yes, the difference is that these functions wait also (or only) for external events you requested.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
in a delphi application it only makes sense to use Sleep in a new thread. if u use sleep in e.g. form1 procedure then the app will appear to delay during that Sleep. user will notice app lock if moves window accros dewktop. the window freeses during Sleep
It is safe, only your messages arrive but do not get handled (no CPU for you). In case of a timer this may get problematic for your program logic.