setInterval(func, 1000)
What if the func takes longer than 1000 ms, will the next call wait for 1000 ms or execute right away?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Flash runtime is single threaded. So whenever there is an action to perform (a function call) then it get queued to the already pending actions. So at any point of time only one function is being executed.
In your case If you function
funcis taking more than 1000 ms to execute i.e. iffuncis in between its execution and time interval expires a new call tofuncis queued. So as soon as firstfuncis finished executing then the next call will be picked if there is any. In this case it will be anotherfunccall. If there were other listener which were called before this then they will be called in order.