By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

Is there a SLEEP command?

Using TCC 13.04.63, XP Professional SP3

Is there SLEEP command?

I want to run a batch file, perpetually which periodically "wakes up" and executes the same command over and over again. I could not see anything which suspend the batch file for 5 minutes.
I am sure I have overlooked sometihng.


Stephen Howe
As Steve said, there's DELAY. My 4UTILS plugin offers WAIT.
v:\> wait
WAIT N[.N]ms|s|m|h|d - delay for N[.N] (float>0) units (ms, s, m, h, d)
WAIT datetime - wait until datetime
It also offers @DTMARK[]:
@DTMARK[NNc[+]] = next time mark; c = s, m, h, d
with +, give date and time instead of datetime
NN: S,M - divisors of 60; H - divisors of 24; D - any positive
With WAIT and @DTMARK[] you can get things done at "canonical" marks in time. For example, at the moment (13:35:12), WAIT @%DTMARK[5m] will provide a delay until 13:40:00. At the moment, WAIT has an omission that I'm intending to fix, namely, you can't interrupt it.
Thanks Vince, I use WAIT extensively for background alarms (with DETACH). @DTMARK was rather mysterious to me until your explanation above.
Stefano, perhaps others, I must add the ability to interrupt a WAIT. Of Ctrl-C and Ctrl-Break, which should be the one that ONLY interrupts the WAIT (letting a batch file continue without prompt) and which should propagate the signal so that ON BREAK, or the default "Cancel batch file" handler will also get the signal?

Similar threads