4 ms·
I think this is likely to be related to the way different browsers implement time. In an effort to improve security, browsers reduce fidelity & accuracy on res
by Shrezzing 3y ago
I think this is likely to be related to the way different browsers implement time.
In an effort to improve security, browsers reduce fidelity & accuracy on results from the `performance.now()` timer methods. If you attempt to call `performance.now()`, and then call it again within 100 microseconds, your second result isn't guaranteed to be in the future compared to the first result.
https://developer.mozilla.org/en-US/docs/Web/API/Performance/now#security_requirements https://developer.mozilla.org/en-US/docs/Web/API/Performance...
If you're implementing a speedtest feature, you'd likely run `performance.now()` iteratively as your high-resolution-timer, and compare that to the number of bytes downloaded. Browsers that perform more significant coarsing will return worse metric-per-second results in that scenario.
- spacebanana7 3y agoCumulatively, these quirky edge cases make learning web dev very difficult.