Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ping with timestamp on Windows CLI

On the Windows command prompt cmd, I use ping -t to 10.21.11.81

Reply from 10.21.11.81: bytes=32 time=3889ms TTL=238 Reply from 10.21.11.81: bytes=32 time=3738ms TTL=238 Reply from 10.21.11.81: bytes=32 time=3379ms TTL=238 

Are there any possibilities to get an output like this?

10:13:29.421875 Reply from 10.21.11.81: bytes=32 time=3889ms TTL=238 10:13:29.468750 Reply from 10.21.11.81: bytes=32 time=3738ms TTL=238 10:13:29.468751 Reply from 10.21.11.81: bytes=32 time=3379ms TTL=238 

Please note that I wanna achieve this with only commands provided by CMD

like image 370
SuicideSheep Avatar asked Jul 23 '14 09:07

SuicideSheep


People also ask

Can you ping with a timestamp?

Fortunately, ping on macOS lets you easily add a timestamp with a single additional option. Just enter ping --apple-time <IP address> to see the time a packet was received, right down to the microsecond.


1 Answers

WindowsPowershell:

option 1

ping.exe -t COMPUTERNAME|Foreach{"{0} - {1}" -f (Get-Date),$_} 

option 2

Test-Connection -Count 9999 -ComputerName COMPUTERNAME | Format-Table @{Name='TimeStamp';Expression={Get-Date}},Address,ProtocolAddress,ResponseTime 
like image 147
Hames Avatar answered Sep 19 '22 13:09

Hames