How to sleep for 5 seconds in Windows Command Prompt?

rem ******** Sleep for 5 seconds ********
ping -n 6 127.0.0.1 > nul
rem **************************************

127.0.0.1 : is the localhost IP address.

-n 6 : there is a 1s delay between each ping, so for a 5s delay you need to do 6 pings.

> nul : suppress the output.

@echo off
echo %time%
timeout 5 > NUL
echo %time%

猜你喜欢

转载自www.cnblogs.com/moiez/p/9144752.html