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.
as far as I know function2 starts after function1 has finished executing…
so the total execution time is 5 minutes in your case…
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…