How often does a common browser prompt a 'script is taking too long' summary

  • 2020-03-30 02:44:01
  • OfStack

Now web, the impact of user access speed is no longer just the file download speed, when all the files from the server to download from the browser can render to the user response time to start, this time will still be very long, at the same time due to the complex interaction, javascript is also becoming more and more, more and more complex, the script running time is reflected in the interface is to respond to user input, slowly to the click browser appear even script timeout.

This document is not intended to cover how to avoid such timeouts and javascript optimization techniques, but rather the limits of what browsers can tolerate. Nicholas c. Zakas summarizes the data below

Chrome: execute over 8 seconds prompt.
IE: prompt when executing more than 5 million Javascript statements.
Firefox: execution over 10 seconds prompts.
Safari: prompt after 5 seconds of execution.
Opera: no matter how long you execute, you won't be prompted.
Generally speaking, it is best for the user not to run the script more than 100ms. If the processing is too slow, you can consider some alternative means, such as loading to prompt the user.

Related articles: