mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
netutils/iperf: guaranteed precision before division
Iperf test on photon/wlan Before: 0.00- 1.08 sec 65536 Bytes 0.00 Mbits/sec After: 0.00- 1.04 sec 74970 Bytes 0.58 Mbits/sec Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
412505d286
commit
b3cfcee47d
1 changed files with 2 additions and 2 deletions
|
|
@ -272,7 +272,7 @@ static void iperf_report_task(FAR void *arg)
|
|||
ts_diff(&last, &start),
|
||||
ts_diff(&now, &start),
|
||||
now_len -last_len,
|
||||
(double)((now_len - last_len) * 8 / 1000000) /
|
||||
((double)((now_len - last_len) * 8) / 1000000) /
|
||||
(double)ts_diff(&now, &last)
|
||||
);
|
||||
if (time != 0 && ts_diff(&now, &start) >= time)
|
||||
|
|
@ -287,7 +287,7 @@ static void iperf_report_task(FAR void *arg)
|
|||
ts_diff(&start, &start),
|
||||
ts_diff(&now, &start),
|
||||
now_len,
|
||||
(double)(now_len * 8 / 1000000) /
|
||||
((double)(now_len * 8) / 1000000) /
|
||||
(double)ts_diff(&now, &start)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue