1 2 3 | setInterval( function (e) { // Don't do this for time-critical animations animate(); // A function that draws the current animation frame }, 1000 / 60); // Approximately 60 frames/second (fps) |
1 2 3 4 5 6 | function animate(time) { // Animation loop draw(time); // A function that draws the current animation frame requestAnimationFrame(animate); // Keep the animation going }; requestAnimationFrame(animate); // Start the animation |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |