Hook into request animation frame or setInterval if rAF not available