Link to home
Start Free TrialLog in
Avatar of Finduilas
Finduilas

asked on

Recurring JavaScript functions

I have two Javascript functions.

On is set to repeat every 5 seconds and the other is set to activate on an event (a click on a button).

They both access the same set of variables - one function setting the variables the other one reading them.

How does Javascript react in the rare occasions where my manually activated function takes place at the same time as my recurring one?

Are they run synchronously or are they "stacked" and running one after another?
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Not sure how javascript handles this. However you could have the setEvent call the getEvent immediately to be sure it doesn't get behind?

-r-
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial