in reply to do something no more than 3 times a second
If you don't mind doing a *busy* loop (which might or might not a bad idea, depending on application), you could take the requirements literally: Before starting the external program, you remember the value of time(). If you found that during the last three executions, you already had recorded the same time value, you just busily loop until the time value increases.
Of course I can imagine circumstances where you will be shot doing this programming style, but this is something you can best decide yourself.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: do something no more than 3 times a second
by ikegami (Patriarch) on Nov 26, 2010 at 23:33 UTC | |
by rovf (Priest) on Nov 29, 2010 at 07:50 UTC | |
by ikegami (Patriarch) on Nov 29, 2010 at 08:00 UTC | |
by rovf (Priest) on Nov 29, 2010 at 10:00 UTC | |
by ikegami (Patriarch) on Nov 29, 2010 at 16:54 UTC | |
|