• 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
Accuracy of NSThread sleepUntilDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accuracy of NSThread sleepUntilDate


  • Subject: Accuracy of NSThread sleepUntilDate
  • From: Christian Mike <email@hidden>
  • Date: Fri, 3 Aug 2001 08:03:06 -0500

I have a multithreaded application in which the threads will sometimes delay
for a short time. I use the code:

NSTimeInterval timeInterval = (NSTimeInterval) someMilliseconds /
1000.0;

[NSThread sleepUntilDate:[NSDate
dateWithTimeIntervalSinceNow:timeInterval]];

Now I am not look for high accuracy here. I realize that when you give up
the processor in a multithreaded application that all bets are off. I am
just looking for some ball park answer about how accurate this delay
mechanism is. What is a reasonably expected quantization unit here?

Is there some better way to put a thread to sleep for a short (10's of
milliseconds) time?

Thanks.

Michael Christian
Thomson multimedia Inc.


  • Prev by Date: re: [HELP] beginCriticalAlertSheet NSSelector implementation
  • Next by Date: Multi-page TIFF file support ?
  • Previous by thread: re: [HELP] beginCriticalAlertSheet NSSelector implementation
  • Next by thread: Re: Accuracy of NSThread sleepUntilDate
  • Index(es):
    • Date
    • Thread