这个问题在这里已经有了答案:
delay a batch file in under a second?
(6 个回答)
6年前关闭。
我想让批处理文件等待 0.5 或 0.25 秒。
我已经试过了 timeout /t 0.5
但它不起作用。
它是这样的:@echo off
color a
cls
:top
echo %random%
timeout /t 0.5
echo %random%
goto top
最佳答案
试试这个:ping 127.0.0.1 -n 1 -w 500> nul
500 是以毫秒为单位的时间。
编辑:
正如 rojo 在评论中发布的那样,这在 250 毫秒内无法按预期工作:
ping used this way pauses a minimum of 500ms. Using any value lower than 500 still results in a half second pause
关于batch-file - 如何使批处理文件等待几分之一秒?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30665100/