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