File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ public double AveragePingMilliseconds() {
5252 foreach ( PingEntry ping in Entries ) {
5353 if ( ping . TimeSent . Ticks == 0 || ping . TimeReceived . Ticks == 0 ) continue ;
5454
55- totalMs += ( ping . TimeReceived - ping . TimeSent ) . TotalMilliseconds ;
55+ // Half, because received->reply time is actually twice time it takes to send data
56+ totalMs += ( ping . TimeReceived - ping . TimeSent ) . TotalMilliseconds * 0.5 ;
5657 measures ++ ;
5758 }
5859 return measures == 0 ? 0 : ( totalMs / measures ) ;
@@ -66,7 +67,7 @@ public double WorstPingMilliseconds() {
6667 foreach ( PingEntry ping in Entries ) {
6768 if ( ping . TimeSent . Ticks == 0 || ping . TimeReceived . Ticks == 0 ) continue ;
6869
69- double ms = ( ping . TimeReceived - ping . TimeSent ) . TotalMilliseconds ;
70+ double ms = ( ping . TimeReceived - ping . TimeSent ) . TotalMilliseconds * 0.5 ;
7071 totalMs = Math . Max ( totalMs , ms ) ;
7172 }
7273 return totalMs ;
You can’t perform that action at this time.
0 commit comments