ping waits for about 5 seconds before timing out, not 1 second as was stated above.
That is, unless you tell it to only wait for 1 second before timing out.
ping 1.0.0.1 -n 1 -w 1000
will ping once, wait only 1 second (1000 ms) for a response, then time out.
So an approximately 20-second delay would be:
ping 1.0.0.1 -n 20 -w 1000