Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How "expensive" are NSTimers

How "expensive" are NSTimers
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Oct 8, 2004, 10:51 AM
 
Hi,

How costsly would it be to have an NSTimer that fires once every 0.5 to 1.0 seconds? Upon firing it just checks the status of a few things, it won't be cause running through huge arrays or anything. Any comments?

Kind Regards,
Ian
     
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Oct 8, 2004, 05:26 PM
 
Originally posted by macrophyllum:
Hi,

How costsly would it be to have an NSTimer that fires once every 0.5 to 1.0 seconds? Upon firing it just checks the status of a few things, it won't be cause running through huge arrays or anything. Any comments?

Kind Regards,
Ian
I can't think of a substantially less-costly way. NSTimer seems to just be a thin Cocoa shim over some CFRunloop stuff, which seems to be a thin shim over the mach calls.

I use NSTimer for exactly what you described and don't consider it to be costly at all.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Oct 9, 2004, 08:48 AM
 
Thanks for the reply. Just what I wanted to hear.
~Ian
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2