downscale
downscale copied to clipboard
Use performance.now() instead of new Date for measuring performance in demo?
Hi,
I noticed that demo use new Date
for measuring performance metrics
https://github.com/ytiurin/downscale/blob/6260f6d81d5fa9fbb5fee9f120eb7e2b21236fdd/demo/multiselect.js#L143-L148
Should it use performance.now()
instead?
- it's more precise in orders of magnitude (SO answer)
- Google lighthouse audit also recommends using performance.now() over Date (link)
Regards, Trivikram