• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: timer below one second wanted
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: timer below one second wanted


  • Subject: Re: timer below one second wanted
  • From: Chris Kane <email@hidden>
  • Date: Mon, 16 Dec 2002 08:23:21 -0800

On Monday, December 16, 2002, at 07:28 AM, Uwe Kuhlmann wrote:
can anyone give me a hint how to set up a timer (as with the NSTimer
class) which is able to produce some event every 100 ms.

I want to code a stopwatch/timer with resolution equal or below 0.1 s.
None of the ready-to-run tools (pester, HBTimer, FinalCountdown ...) I
tried so far has this feature. Is this a restriction of NSTimer ?

If you simply pass in a resolution below 1.0 seconds (say, 0.1 seconds), NSTimer will do that for you. NSTimer places no restrictions on the resolution itself, though there is obviously an ultimate resolution limit in what the particular hardware and particular version of the OS will manage underneath you. And of course, the resolution is limited by the speed of the work _you_ are doing in the handler as well (if your thing takes 0.32 seconds, you won't get resolution greater than 0.32 seconds).

But, at some resolution which is a combination of those factors above, your app is essentially spinning, so I don't recommend actually using fine resolutions. It's possible to starve, to some extent, other things that want to happen in your app (like user input events) as well if you have something really "busy" going on.


Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >timer below one second wanted (From: Uwe Kuhlmann <email@hidden>)

  • Prev by Date: Re: CF Portability
  • Next by Date: (a bit off topic) drive optimization
  • Previous by thread: Re: timer below one second wanted
  • Next by thread: customized folder icons
  • Index(es):
    • Date
    • Thread