setInterval卡顿
时间: 2023-08-28 09:16:22 浏览: 156
回答: 使用setInterval会引起页面卡顿的问题是因为JavaScript是单线程的,当setInterval中的任务执行时间较长时,会阻塞其他任务的执行,导致页面出现卡顿现象。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [VUE倒计时组件,解决setInterval ()引起页面卡顿问题](https://blog.csdn.net/m0_53718249/article/details/125800255)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [解决:setInterVal长时间运行卡顿,采用setTimeout代替setInterval.](https://blog.csdn.net/qq_40207505/article/details/121348967)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文