in reply to Re^3: do something no more than 3 times a second
in thread do something no more than 3 times a second
If you want a busy loop, just comment out the sleep line. I don't see how that makes any sense, though.
Of course, it can, if you use a HiRes timer.
You have to use a timer either way. Or is hires somehow meaningful in that sentence? I don't see why, so could you give a example reason?
there *are* cases where it makes more sense
What would be such a case? I can't think of an example where doing a busy loop is acceptable if the system has a notification API. (In this case, sleep is that API since we're only interested in waiting for an amount of time.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: do something no more than 3 times a second
by rovf (Priest) on Nov 29, 2010 at 10:00 UTC | |
by ikegami (Patriarch) on Nov 29, 2010 at 16:54 UTC | |
by rovf (Priest) on Dec 01, 2010 at 08:40 UTC |