Dos - Simulate Sleep command

By xngo on July 21, 2019

Sleep for 10 seconds.

@ECHO OFF
@REM Make sure to ping a non-existing IP, otherwise ping will exit before the timeout.
@REM Wait for 10 seconds. Note: This is not exactly 10 seconds but close to it.
echo %DATE% %TIME%
PING 1.1.1.1 -n 1 -w 10000 >NUL
echo %DATE% %TIME%

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.