home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / misc / 29193 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.3 KB  |  52 lines

  1. Newsgroups: comp.os.os2.misc
  2. Path: sparky!uunet!destroyer!gatech!news.ans.net!ans.net!db3l
  3. From: db3l@ans.net (David Bolen)
  4. Subject: Re: Wait without loading CPU?
  5. Sender: news@ans.net (News Administrator)
  6. Message-ID: <1992Sep03.160036.51282@ans.net>
  7. In-Reply-To: miller@cogsci.ucsd.EDU's message of 3 Sep 92 03: 34:57 GMT
  8. Date: Thu, 3 Sep 1992 12:02:04 GMT
  9. References: <1557@cogsci.ucsd.EDU>
  10. Organization: Advanced Network & Services, Inc. - Elmsford, NY
  11. Lines: 39
  12.  
  13. In article <1557@cogsci.ucsd.EDU> miller@cogsci.ucsd.EDU (Jeff Miller) writes:
  14.  
  15. >I need to put a "wait" command in a .bat file (DOS box)
  16. >or in a .cmd file (OS/2 box).  The idea is just to let
  17. >some time elapse (e.g., 2 minutes) before going
  18. >on to the next command.  The key problem is that the
  19. >"wait" command should put AS LITTLE LOAD AS POSSIBLE
  20. >on the CPU.
  21.  
  22. I'm not sure about DOS boxes - any DOS program is going to have to loop,
  23. polling the system time to wait a specific period.  I see that either
  24. (a) burning the CPU a bit, or (b) being detected as IDLE by OS/2, which is
  25. fine - I don't know if the idle detection is basically keyboard I/O though.
  26.  
  27. For the OS/2 session though, all you need is a small program that calls
  28. the DosSleep() function.  This will block a thread for the specified amount
  29. of time (error margin = one timeslice and subject to thread priorities)
  30. without using any CPU.
  31.  
  32. For directly from Rexx, I would expect that this is what the SysSleep routine
  33. (part of the RexxUtil functions) does.  You didn't say how you had experimented
  34. sleeping from Rexx, but if you didn't use SysSleep, I'd suggest giving it
  35. a shot.
  36.  
  37. The other alternative is just creating a small program that calls DosSleep().
  38. Over on ftp-os2.nmsu.edu in pub/os2/all/sysutils you can find wait.zoo, that
  39. has a small wait.exe that should do what you want.  Note that it takes its
  40. command line argument and passes it directly to DosSleep() so you need to
  41. specify your delay in ms (1000s of a second), so to sleep for 5 seconds you
  42. would use "wait 5000".
  43.  
  44. --
  45. -- David
  46. --
  47. /-----------------------------------------------------------------------\
  48.  \              David Bolen             \  Internet: db3l@ans.net      /
  49.   |   Advanced Network & Services, Inc.   \   Phone: (914) 789-5327   |
  50.  / 100 Clearbrook Road, Elmsford, NY 10523  \   Fax: (914) 789-5310    \
  51. \-----------------------------------------------------------------------/
  52.