Is it possible to run a block of code (maybe just call a function), and if it does not execute for a certain time, skip it.
//give this function 10 seconds to execute
$value = mega_function();// could take anything from 1-1000 seconds
//if 10 seconds have passed and the value is still not set, abort it and set $value = false;
source
share