Created
June 1, 2015 13:08
-
-
Save CrowdHailer/2a104fba4aecdefe9ede to your computer and use it in GitHub Desktop.
Check how often request animation frame is called compaired to device orientation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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