Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
526 views
in Technique[技术] by (71.8m points)

不懂就问系列 requestAnimationFrame 中存在耗时任务

requestAnimationFrame 是每帧必执行的吗
requestAnimationFrame 中如果放一些耗时任务会掉帧吗


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

requestAnimationFrame传入的回调函数在页面重绘之前调用,个人感觉应该符合你所说的每帧必执行;
在回调函数中处理耗时任务,应该作为性能优化去处理,掉帧什么的无可厚非


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...