ded / morpheus

A Brilliant Animator
504 stars 57 forks source link

Further shim `performance.now` while supporting epoch-based callbacks. #38

Closed danro closed 11 years ago

danro commented 11 years ago

I worked a bit more on my perfNow shim approach. Instead of ignoring the timestamp on each rAF callback, I am validating it. So with this new approach, here is what will happen:

  1. Non-rAF browsers will remain unchanged.
  2. rAF browsers w/out performance.(prefix)now will remain unchanged.
  3. rAF browsers w/ performance.(prefix)now will use the new high-res timestamp.

Also added in @rvagg's new duration test and made it slightly more forgiving (because web browsers are chuggy on page load... thanks Rod for the epic session last night btw).

All tests passing in:

Mixed results in the old dogs:

Really hope this is cool with you guys because I'm fucking tired of typing rAF.

:shipit: