Now the web, the impact of user access is not only the speed of file downloads, when all files from the server download, from the browser to start rendering to the user can respond to the time, this time will still be consumed very long, and because of the complexity of interaction, JavaScript also become more and more complex, The time the script runs is reflected in the interface in response to user input clicks too slow, and even the browser appears script timeout prompts.
This document is not intended to tell you how to avoid this timeout and the optimization techniques of JavaScript, just the endurance limits of the various browsers, the following is the data summarized by Nicholas C. Zakas.
Chrome: Perform more than 8 seconds prompt.
IE: prompted when executing more than 5 million JavaScript statements.
Firefox: Prompts for more than 10 seconds to execute.
Safari: Prompts for more than 5 seconds to execute.
Opera: No prompts will appear no matter how long the execution takes.
In general, the script runtime is best not more than 100ms, if the real deal with the slow time can consider some alternative means, such as using loading prompts the user.