php - Can I set a time limit for a code block? -
is possible start block of code (maybe call function) , if doesn't execute within time skip it.
//give function 10 seconds execute $value = mega_function();// take 1-1000 seconds //if 10 seconds have passed , value still not set, abort , set $value = false;
no. have either
call function inside external file using curl or
file_get_contents()
- can set timeout therekeep track of time inside
mega_function()
,return()
if necessary.
what mega_function()
do?
Comments
Post a Comment