rockinaway Posted July 21, 2012 Share Posted July 21, 2012 I have 2 functions which work with setTimeout to continuously loop. However, they both start executing together and so sometimes information in the files clash and the functions fail. How can I make it so that one function starts and then ONLY WHEN THAT IS FINISHED the next function starts.. and then when that finishes the first function goes again. Any way to do this? Quote Link to comment https://forums.phpfreaks.com/topic/266058-complete-one-function-then-do-next/ Share on other sites More sharing options...
requinix Posted July 22, 2012 Share Posted July 22, 2012 Instead of them calling themselves for the loop, make them call each other. Then only start the one you want to run first. Quote Link to comment https://forums.phpfreaks.com/topic/266058-complete-one-function-then-do-next/#findComment-1363407 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.