From db77b1ec6cdca22a41bd8bd2bdf1ee725d5674e7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 6 Jul 2018 14:44:26 -0600 Subject: [PATCH] apps/examples/tcpblaster: Fix an error in time calculation. --- examples/tcpblaster/tcpblaster_client.c | 1 + examples/tcpblaster/tcpblaster_server.c | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/tcpblaster/tcpblaster_client.c b/examples/tcpblaster/tcpblaster_client.c index 62f3d3938..8407335c3 100644 --- a/examples/tcpblaster/tcpblaster_client.c +++ b/examples/tcpblaster/tcpblaster_client.c @@ -189,6 +189,7 @@ void tcpblaster_client(void) else { unsigned long borrow = 1000000000 - start.tv_nsec; + elapsed.tv_sec--; elapsed.tv_nsec = curr.tv_nsec + borrow; } diff --git a/examples/tcpblaster/tcpblaster_server.c b/examples/tcpblaster/tcpblaster_server.c index 5029e8781..b974918c6 100644 --- a/examples/tcpblaster/tcpblaster_server.c +++ b/examples/tcpblaster/tcpblaster_server.c @@ -218,6 +218,7 @@ void tcpblaster_server(void) else { unsigned long borrow = 1000000000 - start.tv_nsec; + elapsed.tv_sec--; elapsed.tv_nsec = curr.tv_nsec + borrow; }