requestAnimationFrame
window.onload = function () {
var oBox = document.getElementById("box");
var rAF = window.requestAnimationFrame;
var degrees = 0;
function update() {
oBox.style.transform = "rotate(" + degrees + "deg)";
console.log("updated to degrees " + degrees);
degrees = degrees + 2;
rAF(update);
}
rAF(update);
};