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:

  1. nstimer in background thread.
  2. nstimer in main thread.
  3. dispatch_source_timer
  4. 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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -