ios - Application's run loop slows down when receive/initiate a cellular call -
i have timer fires method in every 60ms of interval when application in foreground , fires in same interval if in background.
when initiate/receive cellular call, timer fires method in every 120ms of interval.i thought problem timer, tried following approaches.
approaches have tried:
- nstimer in background thread.
- nstimer in main thread.
- dispatch_source_timer
- while loop 60ms of sleep. (no timer here)
so if use simple while loop, still there delay in firing method. maintain interval changed timer interval 30ms(for approaches) when receive/initiate call result same(120 ms).
i glad if can suggest approach.
from apple doc:
if timer’s firing time occurs during long callout or while run loop in mode not monitoring timer, timer not fire until next time run loop checks timer. therefore, actual time @ timer fires potentially can significant period of time after scheduled firing time
what should remember timer when set time t
, have assurance elapsed time between 2 ticks at least of t.
Comments
Post a Comment