home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12955 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  967 b 

  1. Path: sparky!uunet!sun-barr!olivea!apple!apple!nuntius
  2. From: dwb@apple.com (David W. Berry)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: How do I sleep w/o using any CPU time
  5. Message-ID: <28474@goofy.Apple.COM>
  6. Date: 17 Jul 92 21:19:45 GMT
  7. References: <a684a397@spicewood.uucp>
  8. Sender: usenet@Apple.COM
  9. Organization: Greenwing Enterprises
  10. Lines: 15
  11. X-UserAgent: Nuntius v1.1
  12.  
  13. In article <a684a397@spicewood.uucp>, you write:
  14. >    I am writing an application to check something every so often.  If
  15. >  something exists, I will then put up an error window.  Everything is
  16. Typed in off the type of my head, so this isn't error checked (or really
  17. even syntax checked) but it will give you the general idea...
  18.  
  19. pascal void Delay(long ticks)
  20. {
  21.         long            wakeTime = TickCount() + ticks;
  22.         long            delay;
  23.         EventRecord     event;
  24.  
  25.         while((delay = (wakeTime - TickCount()) > 0)
  26.                 WaitNextEvent(0, &event, delay, 0);
  27. }
  28.