mrchimp / tock

Timer Object/Class. Kickass!
MIT License
237 stars 33 forks source link

Use performance.now() for higher accuracy #16

Open erlingur opened 9 years ago

erlingur commented 9 years ago

Have you looked at using performance.now() instead of Date.now()?

http://updates.html5rocks.com/2012/08/When-milliseconds-are-not-enough-performance-now https://developer.mozilla.org/en-US/docs/Web/API/Performance.now

mrchimp commented 9 years ago

I hadn't. Hmm, looks like I should...

I'll give it a go once #21 is merged.

jneuendorf commented 7 years ago

Hasn't #21 (or #22 relatively) been merged quite a while ago? 😉

There is this library you could use to still have support for older browsers without the performance API (http://caniuse.com/#feat=user-timing). This lib would additionally add support for using tock in pure node environments.

mrchimp commented 7 years ago

Pull requests are accepted ;)

I'll see if I can find some time to look into this soon. Thanks for the link.