Is there a SLEEP command?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 7, 2008
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.
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?