Re: To Insolor and those interested in dos rescue programme
- Posted by Insolor Dec 21, 2012
- 2691 views
useless_ said...
Insolor said...
useless_ said...
Insolor said...
for i = 1 to 3750000 do task_yield() end for
This doesn't look like the proper way to use tasks, but i don't know what you are trying to do. What are you trying to do?
useless
In DOS age the common practice was to make pause with empty loops.
But your empty loop will run at different speeds on different cpus, plus you are calling task_yield() 3,750,000 times! That's got to be a huge overhead!
useless
I agree with you. task_yield() inside an empty loop is rather a solution for legacy code. For windows the better way is a for-loop with a few iterations and with sleep(0.1) and task_yield() in it, eg. 5 second pause:
for i = 1 to 50 do task_yield() sleep(0.1) end for