windowsbatch-fileping

Why does ping ::1 -n 3 only wait 2 seconds?


I am creating a wait program using batch, but when I try to insert the 3 seconds delay using ping :

ping ::1 -n 3 >nul 2>nul

Only waits 2 seconds. Why does this happen?


Solution

  • Because it makes its first ping without a delay (on execution). three pings means 2 delays. If you like to have a delay of 3 seconds, you need to ping 4 times.