How can I do a ping every 500 ms?

You can do this with nping (from the makers of nmap)

  1. First download and install the nmap package which includes nping.
  2. In a command prompt change the directory to C:\Program Files (x86)\Nmap
  3. Now run the following command: nping --delay 500ms --count 0 <target ip address>
    (the --count 0 option sets it to a continuous ping)

....from Nping Reference Guide:

Usage: nping [Probe mode] [Options] {target specification}
....
....
TIMING AND PERFORMANCE:
  Options which take <time> are in seconds, or append 'ms' (milliseconds),
  's' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m, 0.25h).
  --delay <time>                   : Adjust delay between probes.
  --rate  <rate>                   : Send num packets per second.

On Linux it is possible (recently minimum time was changed to 200ms = 0.2):

ping -i 0.2 server.com

Root can issue shorter time:

ping -i 0.01 server.com

You could create an endless loop in PowerShell, send 1 ping there and wait for 500ms after sending it.

while ($true) { Test-Connection ServerName -Count 1 ; Start-Sleep -MilliSeconds 500 }

You can also Wrap it in a Function and put in in your PowerShell Profile to use it anytime

Function New-Ping {
    
    Param(
        [Parameter(Mandatory)]
        [string]$ComputerName,
        [Parameter(Mandatory)]
        [int]$Intervall
    )

    while ($true) { 
        Test-Connection $ComputerName -Count 1
        Start-Sleep -MilliSeconds $Intervall 
    }
}

and use it like this from within PowerShell:

New-Ping ServerName 500

You can also use it in cmd.exe like so:

C:\WINDOWS\system32>powershell new-ping SRV 500

Source        Destination     IPV4Address      IPV6Address                              Bytes    Time(ms)
------        -----------     -----------      -----------                              -----    --------
CP            SRV            10.0.0.226                                                32       0
CP            SRV            10.0.0.226                                                32       0
CP            SRV            10.0.0.226                                                32       0

You can end the endless loop by pressing CTRL + C

Tags:

Ping

Cmd.Exe