1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is there a SLEEP command?

Discussion in 'Support' started by Stephen Howe, Jul 5, 2012.

  1. Stephen Howe

    Joined:
    Jun 7, 2008
    Messages:
    121
    Likes Received:
    0
    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.

    Thanks

    Stephen Howe
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    DELAY 300
    Of course, you can also set it up as a periodic service, and let Windows restart it every 5 min.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,934
    Likes Received:
    30
    As Steve said, there's DELAY. My 4UTILS plugin offers WAIT.
    Code:
    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[]:
    Code:
    @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.
     
  4. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Thanks Vince, I use WAIT extensively for background alarms (with DETACH). @DTMARK was rather mysterious to me until your explanation above.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,934
    Likes Received:
    30
    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?
     
  6. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Vince, my vote: Ctrl+C propagates the signal.
     

Share This Page