home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18718 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.9 KB  |  53 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!weiser@pogo.den.mmc.com
  3. From: weiser@pogo.den.mmc.com (Matt Weiser)
  4. Subject: Re: best way to pause in app ?
  5. Message-ID: <1992Nov20.164209.2573@den.mmc.com>
  6. Sender: news@den.mmc.com (News)
  7. Nntp-Posting-Host: 129.243.25.22
  8. Organization: Martin Marietta WIS
  9. References: <brownlow.722219238@stmartin>
  10. Date: Fri, 20 Nov 1992 16:42:09 GMT
  11. Lines: 40
  12.  
  13. In article <brownlow.722219238@stmartin>, brownlow@informix.com (Keith Brownlow) writes:
  14. > Is there a toolbox command to make the application wait x number of seconds
  15. > before continuing processing ?  I've tried looping for 1000's of seconds but
  16. > without doing anything in the loop, it's more or less instantly coming back.
  17. > Anyone got a simple solution that I've missed in my manuals ?
  18. > -- 
  19. > -------------------------------------------------------------------------------
  20. > |brownlow@informix.com     "Intense !"                                        |
  21. > |brownlow@wet.com          "A repo man's always intense !"                    |
  22. > -------------------------------------------------------------------------------
  23.  
  24. IM Vol II p.384:
  25.  
  26. PROCEDURE Delay (numTicks: LONGINT; VAR finalTicks: LONGINT);
  27. Trap macro _Delay
  28. On entry   A0: numTicks (long word)
  29. On exit    D0: finalTicks (long word)
  30.  
  31. Delay causes the system to wait for the number of ticks (sixtieths of a sec)
  32. specified by numTicks, and returns in finalTicks the total number of ticks
  33. from system startup to the end of the delay.
  34.  
  35. Warning: Don't rely on the duration of the delay being exact; it will
  36. usually be accurate to within one tick, but may be off by more than that.
  37. <why is deleted because I don't think it matters in your case>
  38.  
  39. Example:
  40. void wait( long numOfSecs )
  41. {
  42.    
  43.    long numTicks = numOfSecs * 60;
  44.    long fianlTicks; 
  45.  
  46.    Delay( numTicks, &finalTicks );
  47. }
  48.  
  49. Matt Weiser
  50. weiser@pogo.den.mmc.com
  51.