Skip to content

Instantly share code, notes, and snippets.

@miladj3
Forked from pomber/slowmo.js
Created May 29, 2020 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miladj3/f3af2e009a79ea3a61549fbc778e9817 to your computer and use it in GitHub Desktop.
Save miladj3/f3af2e009a79ea3a61549fbc778e9817 to your computer and use it in GitHub Desktop.
function slowmo(rate = 10) {
window._raf = window.requestAnimationFrame
window.requestAnimationFrame = f => window._raf(t => f(t/rate))
Date._now = Date.now
Date.now = () => Date._now() / rate
performance._now = performance.now
performance.now = () => performance._now()/rate
}
slowmo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment