During the test, alert will interrupt the settimeout timing function, when the dialog box is closed, settimeout time will start to clock, rather than from the interruption, interested friends can understand
The test found that alert interrupts the settimeout timer, and when the dialog box is closed, settimeout time starts over, not from the interrupt.
For example: SetTimeout to execute a method after 5 minutes, but after waiting 3 minutes, pop-up alert, close alert, settimeout will start to time, and then wait 5 minutes, instead of 2 minutes.
And as long as it is within the same browser window, alert interrupts the settimeout in the other frame, even in a different frame.
Why is it so designed, not understood, because JavaScript is single-threaded?
This is found in IE Explorer, other dialog boxes and pop-up boxes I have not tested.
I hope HTML5 faster and more popular, so the function of multithreading needs can be solved.