home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12967 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.7 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!stanford.edu!kronos.arc.nasa.gov!joshr
  3. From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
  4. Subject: Re: How do I sleep w/o using any CPU time
  5. Message-ID: <1992Jul24.000928.10355@kronos.arc.nasa.gov>
  6. Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
  7. Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
  8. Organization: NASA/ARC Information Sciences Division
  9. References: <a684a397@spicewood.uucp> <28474@goofy.Apple.COM>
  10. Date: Fri, 24 Jul 1992 00:09:28 GMT
  11. Lines: 29
  12.  
  13. In article <28474@goofy.Apple.COM> dwb@apple.com (David W. Berry) writes:
  14. >In article <a684a397@spicewood.uucp>, you write:
  15. >>    I am writing an application to check something every so often.  If
  16. >>  something exists, I will then put up an error window.  Everything is
  17. >Typed in off the type of my head, so this isn't error checked (or really
  18. >even syntax checked) but it will give you the general idea...
  19. >
  20. >pascal void Delay(long ticks)
  21. >{
  22. >        long            wakeTime = TickCount() + ticks;
  23. >        long            delay;
  24. >        EventRecord     event;
  25. >
  26. >        while((delay = (wakeTime - TickCount()) > 0)
  27. >                WaitNextEvent(0, &event, delay, 0);
  28. >}
  29.  
  30. The only problem with this, as I remember it
  31. (and please correct me if I'm wrong),
  32. that apple events cannot be masked.  I looked in inside mac for this, but
  33. could not find a reference to this ?fact?.  (looked at The Event Manager,
  34. IM VI, p. 5-29)  I cannot recall where I got this idea from.
  35.  
  36. Can anyone refute or back up this belief?
  37. -- 
  38. ----------------------------------
  39. #include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
  40. joshr@kronos.arc.nasa.gov
  41. "'I see', said the blind carpenter, as he picked up his hammer and saw".
  42.