diff --git a/monitor/analyze.c b/monitor/analyze.c
index 5e0957a..d504c8d 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
if (timerisset(&conn->last_tx)) {
timersub(&conn->last_tx_comp, &conn->last_tx, &res);
- if (!timerisset(&conn->tx_lat_min) ||
- timercmp(&res, &conn->tx_lat_min, <))
+ if ((!timerisset(&conn->tx_lat_min) ||
+ timercmp(&res, &conn->tx_lat_min, <)) &&
+ res.tv_sec >= 0 && res.tv_usec >= 0)
conn->tx_lat_min = res;
if (!timerisset(&conn->tx_lat_max) ||
tmp.tv_usec -= 1000000;
}
}
+
+ conn->tx_lat_med = tmp;
} else
conn->tx_lat_med = res;