I have the following PS code for logging the ping every second:
ping -t google.com | Foreach{"{0} - {1}" -f (Get-Date),$_} >> filename.txt
It indeed logs every second, that is, if the ping is 140ms, the next ping request is in 860ms, as I seemingly have data for every second without skips. However, when a timeout occurs, exactly 5 seconds are skipped every time:
12. 4. 2021 16:13:10 - Reply from 172.217.19.110: bytes=32 time=20ms TTL=111
12. 4. 2021 16:13:11 - Reply from 172.217.19.110: bytes=32 time=79ms TTL=111
12. 4. 2021 16:13:16 - Request timed out.
12. 4. 2021 16:13:17 - Reply from 172.217.19.110: bytes=32 time=26ms TTL=111
12. 4. 2021 16:13:18 - Reply from 172.217.19.110: bytes=32 time=67ms TTL=111
It is hard to believe that every time this happens, the connection is lost for exactly 5 seconds, than restored; it seems that the timing out "blocks" new ping commands. Is there a way to circumvent this?