Home  >  Article  >  Web Front-end  >  Summary of how often common browsers will prompt 'script running time is too long'_javascript tips

Summary of how often common browsers will prompt 'script running time is too long'_javascript tips

WBOY
WBOYOriginal
2016-05-16 16:50:441272browse

In today’s web, it is not just the speed of file downloading that affects user access speed. After all the files are downloaded from the server, the time from when the browser starts rendering to when the user can respond will still consume a lot of time. At the same time, due to the complexity of interactions, JavaScript has become more and more complex. The running time of the script is reflected in the interface, which is too slow to respond to user input clicks, and even the browser may prompt a script timeout.

This document does not intend to talk about how to avoid this timeout and JavaScript optimization techniques. It only talks about the tolerance limits of various browsers. The following is the data summarized by Nicholas C. Zakas

Chrome: Execution takes more than 8 seconds prompt.
IE: Prompt appears when executing more than 5 million Javascript statements.
Firefox: A prompt will appear if the execution exceeds 10 seconds.
Safari: A prompt will appear if the execution exceeds 5 seconds.
Opera: No prompt will appear no matter how long it takes to execute.
Generally speaking, it is best for users not to exceed 100ms in script running time. If the processing is too slow, some workarounds can be considered, such as using loading to prompt the user.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn