如何用requestanimationframe 代替 setinterval 来写定时器
window.requestAnimationFrame('gameloop'); 这样写 不会调用自身
function gameloop(){
window.requestAnimationFrame('gameloop');//会根据系统自己计算时间间隔
render();
update();
}