Increase ping sample size from 10 to 12 (#1022)

This commit is contained in:
Logan McNaughton authored and GitHub committed 2026-06-06 13:57:53 +00:00
1 parent 3184305c41
commit 73f145a35c
1 file changed
+2 -2
+2 -2
View File
@@ -428,8 +428,8 @@ fn update_ping(
.as_millis();
let ping = (now - message.timestamp) / 2; // calculate one-way latency
pings.push(ping);
if pings.len() > 10 {
// once we have 10 samples, remove the highest 2 and return the next highest
if pings.len() > 12 {
// once we have at least 12 samples, remove the highest 2 and return the next highest
pings.sort();
pings.truncate(pings.len() - 2);
let ping = *pings.last().unwrap();