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

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

Open
trivikr opened this issue Apr 11, 2019 · 0 comments

Comments

@trivikr
Copy link

trivikr commented Apr 11, 2019

Hi,

I noticed that demo use new Date for measuring performance metrics

var start = new Date
canvasResize(source, WIDTH, HEIGHT).
then(function(r) {
canvTime = (new Date) - start
next(r)
})

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

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

1 participant