2

Let's say i have two functions in functions.php in Wordpress.

function1(){
  // it takes 2 minutes to finish whatever it does
}
function2(){
  // it takes 3 minutes to finish whatever it does
}
function1();
function2();

My question is how are the functions executed?

1.First is executed function1 and when it's finished starts the execution of function2, so the final time will be 5 minutes?

2.The execution for both starts in the same time and the final time will be 3 minutes?

Hope you'll understang my problem, thanks.

2 Answers 2

3

as far as I know function2 starts after function1 has finished executing... so the total execution time is 5 minutes in your case...

Sign up to request clarification or add additional context in comments.

Comments

0

5 Minutes - PHP will run the functions one after the other, as opposed to the likes of JS that will run them concurrently.

I would question what takes 2-3 minutes to process in PHP though? Most browsers will time out after 30 seconds of PHP execution, so 5 minutes would be way to long...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.