apps/examples/tcpblaster: Fix an error in time calculation.
This commit is contained in:
parent
19b8a52500
commit
db77b1ec6c
@ -189,6 +189,7 @@ void tcpblaster_client(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned long borrow = 1000000000 - start.tv_nsec;
|
unsigned long borrow = 1000000000 - start.tv_nsec;
|
||||||
|
elapsed.tv_sec--;
|
||||||
elapsed.tv_nsec = curr.tv_nsec + borrow;
|
elapsed.tv_nsec = curr.tv_nsec + borrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,6 +218,7 @@ void tcpblaster_server(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned long borrow = 1000000000 - start.tv_nsec;
|
unsigned long borrow = 1000000000 - start.tv_nsec;
|
||||||
|
elapsed.tv_sec--;
|
||||||
elapsed.tv_nsec = curr.tv_nsec + borrow;
|
elapsed.tv_nsec = curr.tv_nsec + borrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user