Re: Repeating timer firing way to fast
On May 22, 2018, at 04:15 , Jonathan Taylor <jonathan.taylor@...> wrote:
It seems to me that this could be regarded as a bug in your design. The consequence of blocking, at a higher conceptual level, is that it destroys the concept of timing which is essential to your task.
One alternative is to use the timer callback *only* to decide whether it has been 4 or more seconds since the last time the secondary process action finished (or, more than 4 seconds since it last started, *and* that it has finished), and, if so, to trigger the action asynchronously. The precise details will depend on how you want the system to behave in the face of delays.
Or, you could switch to a recurring NSTimer. That has an API contract about what happens when scheduled firings are missed: