中国开发网: 论坛: 程序员情感CBD: 贴子 105989
Fish
在 4NT 下找到内部命令 DELAY
DELAY

Purpose: Pause for a specified length of time.
Format: DELAY [/B /M time]

time: The number of seconds or milliseconds to delay.

/B(reak enabled) /M(illiseconds)

Usage

DELAY is useful in batch file loops while waiting for something to occur. To wait for 10 seconds:

delay 10

DELAY is most useful when you need to wait a specific amount of time for an external event, or check a system condition periodically. For example, this batch file checks the battery status (as reported by your Advanced Power Management drivers) every 15 seconds, and gives a warning when battery life falls below 30%:

do forever

iff %_apmlife lt 30 then

beep 440 4 880 4 440 4 880 4

echo Low Battery!!

endiff

delay 15

enddo

The seconds value can be as large as about 1 billion seconds (34 years!).

4NT uses the minimum possible processor time during a DELAY, in order to allow other applications full use of system resources.

You can cancel a delay by pressing Ctrl-C or Ctrl-Break.

Options

/B (Break) Allows terminating a DELAY by pressing a key.
/M (Milliseconds) Count by milliseconds instead of seconds. Normally only used for delays of less than 1 second.
大家都是出来卖的,何苦自己人为难自己人
那些活好的,或者活新的,或者花样多的,
或者老板拉皮条功夫好能拉到肯多花钱的客的,
拜托不要老是打击年老色衰的同行了

老鱼记事 老鱼侃棋 老鱼围脖


相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录