downscale icon indicating copy to clipboard operation
downscale copied to clipboard

Use performance.now() instead of new Date for measuring performance in demo?

Open trivikr opened this issue 5 years ago • 0 comments

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

trivikr avatar Apr 11 '19 20:04 trivikr