1
PS C:\Users\Family> Measure-Command { start-process ping -argumentlist 192.168.5.1 -wait}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 4
Milliseconds      : 56
Ticks             : 40561631
TotalDays         : 4.69463321759259E-05
TotalHours        : 0.00112671197222222
TotalMinutes      : 0.0676027183333333
TotalSeconds      : 4.0561631
TotalMilliseconds : 4056.1631

The output of the the ping command

Pinging 192.168.5.1 with 32 bytes of data:
Reply from 192.168.5.1: bytes=32 time<1ms TTL=64
Reply from 192.168.5.1: bytes=32 time<1ms TTL=64
Reply from 192.168.5.1: bytes=32 time<1ms TTL=64
Reply from 192.168.5.1: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.5.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

As per the question, even though total round trip time should be 4 x 1ms + overhead of program execution it takes way longer.

Is there a timeout before displaying each ping result, even if you have received a response? Is the delay in UI that significant? Or is there something else that makes the program this slow.

This is on win10 64bit. I'm sure there can be alternatives that provide a faster response time.

5
  • 3
    It’s kind of obvious when you run the command isn’t it? It delays 1 second after each ping and by default ping sends 4 pings. Use the -n and -w switches if you want different behavior. Dec 29 '17 at 5:55
  • yes why the delay? adding -w 2 didn't change the timing much. as an aside how can i pass -w 2 to the measure command Dec 29 '17 at 6:07
  • 2
    You can’t change the timing. It’s not Linux. Ping delays 1 second. If you want less delays then use -n 1 to send only 1 ping and run the command multiple times as fast as you want. -w allows you to prevent ping from waiting for something like 2 seconds for a ping reply before failing. Dec 29 '17 at 6:12
  • 1
    Thanks @Appleoddity you are right, changing to -n 1 does resolve it instantly. I haven't been able to use measure-command with that parameter though. Anyway you should write an answer so that I can accept it Dec 29 '17 at 6:21
  • Figured it out for measure-command , have to put the argumentlist in quotes. Measure-Command { start-process ping -argumentlist "192.168.5.1 -n 1" -wait} Dec 29 '17 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.