Skip to content

Instantly share code, notes, and snippets.

@CrowdHailer
Created June 1, 2015 13:08
Show Gist options
  • Save CrowdHailer/2a104fba4aecdefe9ede to your computer and use it in GitHub Desktop.
Save CrowdHailer/2a104fba4aecdefe9ede to your computer and use it in GitHub Desktop.
Check how often request animation frame is called compaired to device orientation
<script>
var i = 0
var deviceOrientationData
window.addEventListener('deviceorientation', function( event ) {
deviceOrientationData = event;
i = i + 1
}, false);
function AddCount() {
var str = '<br>' + i
document.body.innerHTML += str
window.requestAnimationFrame(AddCount)
}
window.requestAnimationFrame(AddCount);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment