fix: keep sub-millisecond precision in ping and jitter - #129
Merged
maddie merged 1 commit intoAug 11, 2026
Conversation
BKPepe
force-pushed
the
fix/sub-millisecond-ping-precision
branch
2 times, most recently
from
August 11, 2026 08:32
05013a8 to
dead4b8
Compare
Duration.Milliseconds truncates to whole milliseconds, and every round-trip sample went through it -- in the ICMP path and in the TCP fallback that --no-icmp selects. On a link faster than a millisecond that leaves nothing. Against a server on loopback, reporting only ping and jitter: before ping 0 jitter 0 after ping 0.11 jitter 0.01 Over a wider link the reported ping still looks fractional, because it is an average of the samples, but its resolution is a whole millisecond and jitter is a difference of those samples. Three consecutive ICMP runs against the same server: before ping 5, 6, 5 jitter 0.59, 4.40, 0.02 after ping 5.48, 5.68, 5.45 jitter 0.27, 0.32, 0.12 Divide by time.Millisecond instead, which keeps the fraction.
BKPepe
force-pushed
the
fix/sub-millisecond-ping-precision
branch
from
August 11, 2026 08:44
dead4b8 to
3144947
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Duration.Millisecondstruncates to whole milliseconds, and every round-tripsample went through it — in the ICMP path and in the TCP fallback that
--no-icmpselects. On a link faster than a millisecond that leaves nothing.Against a server on loopback, reporting only ping and jitter:
Over a wider link the reported ping still looks fractional, because it is an
average of the samples — but its resolution is a whole millisecond, and jitter
is a difference of those samples. Three consecutive ICMP runs against the same
server:
Dividing by
time.Millisecondkeeps the fraction.