Nowadays, the impact on user access speed is no longer just the speed of file download. When all files are downloaded from the server, the time from the browser to the time when the user can respond will still be consumed a long time. At the same time, due to the complexity of interaction, JavaScript has become more and more complex. The time for scripts to run is reflected in the interface, which is too slow to respond to user input clicks, and even the browser prompts that script timeouts.
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. Below is the data summarized by Nicholas C. Zakas
Chrome: Execute more than 8 seconds to prompt.
IE: A prompt appears when executing more than 5 million Javascript statements.
Firefox: The prompt appears after execution for more than 10 seconds.
Safari: The prompt appears after execution for more than 5 seconds.
Opera: There will be no prompt no matter how long it takes to execute.
Generally speaking, the script run time should not exceed 100ms for users. If the processing is too slow, you can consider some workarounds, such as using loading to prompt the user.