Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ping Result with Decimal Place (sub milliseconds) #141

Open
zR-JB opened this issue Jul 26, 2024 · 11 comments
Open

Feature Request: Ping Result with Decimal Place (sub milliseconds) #141

zR-JB opened this issue Jul 26, 2024 · 11 comments

Comments

@zR-JB
Copy link

zR-JB commented Jul 26, 2024

Or is this not possible because of the accuracy of:
https://developer.mozilla.org/en-US/docs/Web/API/Performance/now

used in

https://github.com/openspeedtest/Docker-Image/blob/main/files/www/assets/js/app-2.5.4.js#L1319 ?
?

@zR-JB
Copy link
Author

zR-JB commented Jul 26, 2024

Maybe it is possible, they claim sub millisecond accuracy:
https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/High_precision_timing

@zR-JB
Copy link
Author

zR-JB commented Jul 26, 2024

What is the reason, that Math.floor() ist used there ?

@openspeedtest
Copy link
Owner

@zR-JB Check https://github.com/openspeedtest/Docker-Image/blob/main/files/www/assets/js/app-2.5.4.js#L1337C13-L1340C21 I did that because of Safari. Safari will return zero if we go for sub-millisecond accuracy.

@zR-JB
Copy link
Author

zR-JB commented Jul 26, 2024

How much work would an extra flag be, to enable this for the users that want it ?

@openspeedtest
Copy link
Owner

@zR-JB It's easy. If necessary, I can add a flag in the next version, and I am planning to do that in the coming weeks. But who cares about sub-millisecond accuracy? What is the real-world application?

@zR-JB
Copy link
Author

zR-JB commented Jul 26, 2024

Many use openspeedtest inside their home network.

For me e.g. I always get 1ms reading at home, but 0,5 ms and 1,95 is a huge difference when debugging Wi-Fi or even LAN.

And with my new Fiber line I also get sub-millisecond latency to some other public services, so at least the first decimal place matters. I think 0,2 ms latency to the first hop is pretty much standard nowadays.

Or let's say I introduce a new Router or Layer 3 Switch inside my home network (between two subnets or so) and want to measure the impact on real world latency.

@openspeedtest
Copy link
Owner

@zR-JB Thank you for pointing out this issue. I will address it very soon.

@Weegley
Copy link

Weegley commented Aug 10, 2024

According to Mozilla You will not get precision better than 1 ms in Firefox anyway...
Chrome and Edge seem to give 0.1ms precision ping results.

@zR-JB
Copy link
Author

zR-JB commented Aug 10, 2024

According to Mozilla You will not get precision better than 1 ms in Firefox anyway... Chrome and Edge seem to give 0.1ms precision ping results.

Yeah, I did some further testing and got 0.1ms accuracy only with chromium based browsers!

@vishnunuk
Copy link

@zR-JB Yes
FF Array(9) [ 1, 0, 1, 0, 0, 1, 0, 0, 1 ]

Chrome (9) [1.5, 1, 0.5999999940395355, 0.3999999910593033, 0.3999999910593033, 0.6000000089406967, 0.9000000059604645, 0.5999999940395355, 0.5999999940395355]

Safari [0.9999999999999858, 1, 1, 1, 0.9999999999999858, 1, 1, 1, 1] (9)

I think it's better to report what the browser returns, but you'll see 0 on Firefox and 0.1 on Chrome and Safari.

@zR-JB
Copy link
Author

zR-JB commented Aug 11, 2024

Yes would say so, too. If the flag is set, report the raw browser response. Maybe in the future something changes with the browser's too, so who knows. Might be even more helpful in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants