Open zR-JB opened 4 months ago
Maybe it is possible, they claim sub millisecond accuracy: https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/High_precision_timing
What is the reason, that Math.floor() ist used there ?
@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.
How much work would an extra flag be, to enable this for the users that want it ?
@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?
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.
@zR-JB Thank you for pointing out this issue. I will address it very soon.
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.
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!
@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.
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!
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 ? ?