ddsperf: fix calculation of data rate in Mb/s
Multiplying time-in-ns since previous output line by 1e9 instead of dividing it by 1e9 resulted in bit rate showing up as 0Mb/s. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
fc5a349a72
commit
6011422566
1 changed files with 1 additions and 1 deletions
|
@ -1298,7 +1298,7 @@ static void print_stats (dds_time_t tstart, dds_time_t tnow, dds_time_t tprev)
|
|||
if (nrecv > 0)
|
||||
{
|
||||
printf ("%s ntot %"PRIu64" delta: %"PRIu64" lost %"PRIu64" rate %.2f Mb/s\n",
|
||||
prefix, tot_nrecv, nrecv, nlost, (double) nrecv_bytes * 8 / 1e6 / (1e9 * (double) (tnow - tprev)));
|
||||
prefix, tot_nrecv, nrecv, nlost, (double) nrecv_bytes * 8 * 1e3 / (double) (tnow - tprev));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue