D Deleted member 103 Guest Sep 15, 2018 #2 Without DoEvents, that's magic! Thank you LucaMs! Upvote 0
MarkusR Well-Known Member Licensed User Longtime User Sep 15, 2018 #3 would not sleep(5000) the same? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 16, 2018 #4 This is a common mistake to try to "wrap" sleep with a sub that only makes the usage more complicated. As MarkusR wrote you should instead use Sleep directly. It will be simpler and more efficient. Upvote 0
This is a common mistake to try to "wrap" sleep with a sub that only makes the usage more complicated. As MarkusR wrote you should instead use Sleep directly. It will be simpler and more efficient.
Erel B4X founder Staff member Licensed User Longtime User Sep 16, 2018 #5 LucaMs said: Sleep can not allow to achieve the prefixed purpose: Click to expand... That's true. However there isn't any other code that will allow it (without using the problematic DoEvents) as holding the main thread is a bad idea. LucaMs said: This thread should be deleted, as I wrote in the title (but this was ignored) as this is not a useful snippet. Click to expand... I've moved it to the questions forum. I prefer not to delete complete discussions. This is indeed a common mistake. If I remember correctly I even talk about it in the video tutorial. Upvote 0
LucaMs said: Sleep can not allow to achieve the prefixed purpose: Click to expand... That's true. However there isn't any other code that will allow it (without using the problematic DoEvents) as holding the main thread is a bad idea. LucaMs said: This thread should be deleted, as I wrote in the title (but this was ignored) as this is not a useful snippet. Click to expand... I've moved it to the questions forum. I prefer not to delete complete discussions. This is indeed a common mistake. If I remember correctly I even talk about it in the video tutorial.