NSTimer Running always or somtimes
Im making a grid based game and im wating to animate the characters move for a short time after a key is pressed, should I start an NSTimer each time a key is pressed or have one always running?
Sir, e^iπ + 1 = 0, hence God exists; reply!
Completely up to you. You'd get the same effect either way. Personally, I'd leave a timer running all the time, because I'd only have to set it up once, and would most likely use it for other things in the future. If you fire off a new timer each time you need one, you'll probably waste less CPU time, but the amount that it would use in the first place is so small that this is irrelevant.
So, do whichever seems the most logical to you.
- Alex Diener
So, do whichever seems the most logical to you.
- Alex Diener
I would personally keep one running the whole time too, NSTimer takes up very little processing power and create and dealloc it over and over again seems like a headache you dont need to put yourself through. But either way will work just fine.
It not me with the headache, it my computer and it doesnt seem to mind.
I guess I better try the other one though, seeing as it does seem like the better option, thanks guys.
I guess I better try the other one though, seeing as it does seem like the better option, thanks guys.
Sir, e^iπ + 1 = 0, hence God exists; reply!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Using NSTimer in SDL Loop. | Talyn | 7 | 3,692 |
Oct 7, 2008 09:40 PM Last Post: OneSadCookie |
|
| NSTimer / animation framerate question | MonitorFlickers | 5 | 4,515 |
Dec 4, 2005 01:10 PM Last Post: MonitorFlickers |
|
| Cocoa Event Loop/NSTimer revisited | Fenris | 6 | 4,585 |
Oct 29, 2005 11:27 PM Last Post: maaaaark |
|
| NSTimer/NSAffineTransform | Coin | 6 | 3,536 |
Feb 4, 2005 06:23 PM Last Post: Coin |
|

