mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-16 01:05:15 +08:00
[components][netdev] Fix ping maximum & minimum latency counting
This commit is contained in:
1 parent
b88861d285
commit
6040d6cf2c
1 file changed
+5
-1
@@ -1400,7 +1400,11 @@ int netdev_cmd_ping(char* target_name, char *netdev_name, rt_uint32_t times, rt_
|
||||
ping_resp.data_len, inet_ntoa(ping_resp.ip_addr), index + 1, ping_resp.ttl, ping_resp.ticks);
|
||||
}
|
||||
received += 1;
|
||||
if (ping_resp.ticks > max_time)
|
||||
if (received == 1)
|
||||
{
|
||||
max_time = min_time = ping_resp.ticks;
|
||||
}
|
||||
else if (ping_resp.ticks > max_time)
|
||||
{
|
||||
max_time = ping_resp.ticks;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user