sys/shell: fixed percentage calc of ping6 shell cmd
This commit is contained in:
parent
0b3b0c770a
commit
b803438774
@ -220,7 +220,8 @@ int _icmpv6_ping(int argc, char **argv)
|
|||||||
if (success > 0) {
|
if (success > 0) {
|
||||||
timex_normalize(&sum_rtt);
|
timex_normalize(&sum_rtt);
|
||||||
printf("%d packets transmitted, %d received, %d%% packet loss, time %"
|
printf("%d packets transmitted, %d received, %d%% packet loss, time %"
|
||||||
PRIu32 ".06%" PRIu32 " s\n", n, success, (success - n) / n,
|
PRIu32 ".06%" PRIu32 " s\n", n, success,
|
||||||
|
(100 - ((success * 100) / n)),
|
||||||
sum_rtt.seconds, sum_rtt.microseconds);
|
sum_rtt.seconds, sum_rtt.microseconds);
|
||||||
timex_t avg_rtt = timex_from_uint64(timex_uint64(sum_rtt) / n); /* get average */
|
timex_t avg_rtt = timex_from_uint64(timex_uint64(sum_rtt) / n); /* get average */
|
||||||
printf("rtt min/avg/max = "
|
printf("rtt min/avg/max = "
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user