summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-10-04 10:07:22 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-10-04 18:47:53 +0000
commitdc7b1aa1e3c451b0ffc18543f06aa03eae56a087 (patch)
treecd80746225571ef7683de071bcf3193718b7358a /src/vcl
parent3048b63de968ef616baf14e1abbb6502bd4fdcbc (diff)
vcl: fix test throughput computation
Change-Id: I78260cd1a412e93a5d6686888b6ea17f52245a4a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/sock_test_common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vcl/sock_test_common.h b/src/vcl/sock_test_common.h
index 8206fa2264c..335539714bb 100644
--- a/src/vcl/sock_test_common.h
+++ b/src/vcl/sock_test_common.h
@@ -253,7 +253,7 @@ sock_test_stats_dump (char * header, sock_test_stats_t * stats,
if ((stats->stop.tv_nsec - stats->start.tv_nsec) < 0)
{
diff.tv_sec = stats->stop.tv_sec - stats->start.tv_sec - 1;
- diff.tv_nsec = stats->stop.tv_nsec - stats->start.tv_nsec + 1000000000;
+ diff.tv_nsec = stats->stop.tv_nsec - stats->start.tv_nsec + 1e9;
}
else
{
@@ -263,7 +263,7 @@ sock_test_stats_dump (char * header, sock_test_stats_t * stats,
duration = (double) diff.tv_sec + (1e-9 * diff.tv_nsec);
total_bytes = stats->tx_bytes + stats->rx_bytes;
- rate = (double) total_bytes * 8 / duration / ONE_GIG;
+ rate = (double) total_bytes * 8 / duration / 1e9;
printf ("\n%s: Streamed %lu bytes\n"
" in %lf seconds (%lf Gbps %s-duplex)!\n",
header, total_bytes, duration, rate,