Alternative to NSTimer
I wrote a quite test program running a timer 120 times a second to see what sort of variation in time period I got.
The app was the basic view template application with the timer scheduled using:
[NSTimer scheduledTimerWithTimeInterval:1.0/120.0 target:self selector:@selector(myTimer
userInfo:nil repeats:YES];
The timer behaves nicely when there is no user interaction going on. The timer function get's called approximately every 0.008333 seconds. Things get a lot more variable when you have the user touching the screen.
Here's my result running over a 30 second period:
No touches
0.006008,3
0.006832,3
0.007655,1763
0.008479,27
0.009302,3
0.010126,0
0.010950,0
0.011773,0
0.012597,0
0.013420,0
0.014244,1
Touching, tapping swiping the screen etc
0.002097,5
0.003344,25
0.004591,29
0.005838,247
0.007085,1258
0.008332,1726
0.009579,252
0.010826,27
0.012073,24
0.013320,5
0.014567,1
Multi-touch enabled with touching tapping and swiping the screen
0.002818,9
0.003929,14
0.005039,23
0.006150,202
0.007261,2684
0.008371,433
0.009482,189
0.010593,21
0.011704,14
0.012814,9
0.013925,1
The app was the basic view template application with the timer scheduled using:
[NSTimer scheduledTimerWithTimeInterval:1.0/120.0 target:self selector:@selector(myTimer
userInfo:nil repeats:YES];The timer behaves nicely when there is no user interaction going on. The timer function get's called approximately every 0.008333 seconds. Things get a lot more variable when you have the user touching the screen.
Here's my result running over a 30 second period:
No touches
0.006008,3
0.006832,3
0.007655,1763
0.008479,27
0.009302,3
0.010126,0
0.010950,0
0.011773,0
0.012597,0
0.013420,0
0.014244,1
Touching, tapping swiping the screen etc
0.002097,5
0.003344,25
0.004591,29
0.005838,247
0.007085,1258
0.008332,1726
0.009579,252
0.010826,27
0.012073,24
0.013320,5
0.014567,1
Multi-touch enabled with touching tapping and swiping the screen
0.002818,9
0.003929,14
0.005039,23
0.006150,202
0.007261,2684
0.008371,433
0.009482,189
0.010593,21
0.011704,14
0.012814,9
0.013925,1
| Messages In This Thread |
|
Alternative to NSTimer - demonpants - Mar 18, 2009, 02:51 PM
Alternative to NSTimer - longjumper - Mar 18, 2009, 04:15 PM
Alternative to NSTimer - demonpants - Mar 18, 2009, 11:48 PM
Alternative to NSTimer - Frank C. - Mar 19, 2009, 01:28 AM
Alternative to NSTimer - godexsoft - Mar 19, 2009, 02:15 AM
Alternative to NSTimer - riruilo - Mar 20, 2009, 02:56 AM
Alternative to NSTimer - demonpants - Mar 20, 2009, 11:29 AM
Alternative to NSTimer - JustinFic - Mar 20, 2009, 12:01 PM
Alternative to NSTimer - demonpants - Mar 20, 2009, 02:07 PM
Alternative to NSTimer - godexsoft - Mar 23, 2009, 09:04 AM
Alternative to NSTimer - godexsoft - Mar 23, 2009, 09:07 AM
Alternative to NSTimer - GregoryM - Mar 24, 2009, 01:15 AM
Alternative to NSTimer - demonpants - Mar 25, 2009, 05:07 PM
Alternative to NSTimer - godexsoft - Mar 26, 2009, 02:25 AM
Alternative to NSTimer - demonpants - Mar 26, 2009, 10:08 AM
Alternative to NSTimer - Ammonium - Apr 6, 2009, 12:44 PM
Alternative to NSTimer - demonpants - Apr 8, 2009, 02:43 PM
Alternative to NSTimer - mterlecki - May 12, 2009, 09:26 AM
Alternative to NSTimer - longjumper - May 12, 2009, 06:08 PM
Alternative to NSTimer - mister_t - May 13, 2009, 12:49 PM
Alternative to NSTimer - green_ghost - May 13, 2009, 11:12 PM
Alternative to NSTimer - bmantzey - May 15, 2009, 09:25 AM
Alternative to NSTimer - warmi - May 15, 2009, 10:49 AM
Alternative to NSTimer - warmi - May 15, 2009, 10:53 AM
Alternative to NSTimer - green_ghost - May 15, 2009, 07:45 PM
Alternative to NSTimer - ShiftZ - May 16, 2009, 02:24 AM
Alternative to NSTimer - mpatric - May 18, 2009, 09:49 AM
Alternative to NSTimer - ShiftZ - May 18, 2009, 11:55 AM
Alternative to NSTimer - warmi - May 18, 2009, 12:03 PM
Alternative to NSTimer - DoG - May 18, 2009, 02:56 PM
Alternative to NSTimer - warmi - May 18, 2009, 07:46 PM
Alternative to NSTimer - mpatric - May 19, 2009, 02:27 AM
Alternative to NSTimer - DoG - May 19, 2009, 04:07 PM
Alternative to NSTimer - warmi - May 19, 2009, 08:38 PM
Alternative to NSTimer - DoG - May 20, 2009, 02:08 AM
Alternative to NSTimer - ShiftZ - May 20, 2009, 04:48 AM
Alternative to NSTimer - iamflimflam1 - May 20, 2009 07:33 AM
Alternative to NSTimer - DoG - May 20, 2009, 07:42 AM
Alternative to NSTimer - ShiftZ - May 20, 2009, 08:35 AM
Alternative to NSTimer - warmi - May 20, 2009, 09:08 AM
Alternative to NSTimer - mpatric - May 20, 2009, 11:23 AM
Alternative to NSTimer - mpatric - May 20, 2009, 11:26 AM
Alternative to NSTimer - mpatric - May 20, 2009, 11:31 AM
Alternative to NSTimer - ShiftZ - May 20, 2009, 12:12 PM
Alternative to NSTimer - DoG - May 20, 2009, 02:44 PM
Alternative to NSTimer - warmi - May 20, 2009, 08:17 PM
Alternative to NSTimer - arekkusu - May 20, 2009, 09:05 PM
Alternative to NSTimer - AnotherJake - May 20, 2009, 09:43 PM
Alternative to NSTimer - warmi - May 20, 2009, 10:27 PM
Alternative to NSTimer - maximile - May 21, 2009, 05:46 AM
Alternative to NSTimer - arekkusu - May 21, 2009, 05:47 AM
Alternative to NSTimer - warmi - May 21, 2009, 07:32 AM
Alternative to NSTimer - AnotherJake - May 21, 2009, 07:35 AM
Alternative to NSTimer - arekkusu - May 21, 2009, 09:24 AM
Alternative to NSTimer - warmi - May 21, 2009, 09:43 AM
Alternative to NSTimer - arekkusu - May 21, 2009, 09:58 AM
Alternative to NSTimer - warmi - May 21, 2009, 10:19 AM
Alternative to NSTimer - DoG - May 22, 2009, 01:39 AM
Alternative to NSTimer - warmi - May 22, 2009, 09:14 AM
Alternative to NSTimer - demonpants - Jun 8, 2009, 02:41 PM
Alternative to NSTimer - reklis - Jul 12, 2009, 01:36 PM
Alternative to NSTimer - maximile - Jul 13, 2009, 06:50 AM
Alternative to NSTimer - mpatric - Jul 13, 2009, 07:10 AM
Alternative to NSTimer - Frank C. - Jul 13, 2009, 11:33 AM
Alternative to NSTimer - longjumper - Jul 13, 2009, 11:44 AM
Alternative to NSTimer - mpatric - Jul 13, 2009, 12:06 PM
Alternative to NSTimer - warmi - Jul 14, 2009, 12:18 AM
Alternative to NSTimer - DoG - Jul 14, 2009, 12:43 AM
Alternative to NSTimer - warmi - Jul 14, 2009, 08:12 AM
Alternative to NSTimer - mpatric - Jul 14, 2009, 08:12 AM
Alternative to NSTimer - AnotherJake - Jul 14, 2009, 08:35 AM
Alternative to NSTimer - warmi - Jul 14, 2009, 09:09 AM
Alternative to NSTimer - longjumper - Jul 14, 2009, 09:18 AM
Alternative to NSTimer - warmi - Jul 14, 2009, 09:38 AM
Alternative to NSTimer - AnotherJake - Jul 14, 2009, 09:45 AM
Alternative to NSTimer - AnotherJake - Jul 14, 2009, 09:47 AM
Alternative to NSTimer - DoG - Jul 14, 2009, 01:21 PM
Alternative to NSTimer - reklis - Jan 8, 2010, 08:34 PM
Alternative to NSTimer - riruilo - Jan 11, 2010, 01:52 PM
|
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| NSTimer fine, CADisplayLink having some issues | monteboyd | 5 | 7,509 |
Aug 31, 2010 07:05 PM Last Post: Skorche |
|
| NSTimer hiccups/choppy/jerky | jeonghyunhan | 2 | 2,407 |
Sep 24, 2009 07:35 PM Last Post: jeonghyunhan |
|
| Using an NSTimer to progressively draw a view | StevenD | 4 | 3,686 |
May 14, 2009 07:57 AM Last Post: StevenD |
|
| OpenGL render loop - NSTimer vs rendering thread | smallstepforman | 27 | 20,528 |
Feb 2, 2009 10:22 AM Last Post: ThemsAllTook |
|
| Alternative Input/Control Ideas | chrisco | 8 | 3,878 |
Aug 6, 2008 03:21 PM Last Post: bruss14 |
|

