Limit execution time of an function or command PHP -
Hi, there is a possibility to set the deadline for only one command or only one function eg:
< Pre> function doSomething () {//. Code here .. function1 (); // .. Here are some codes ..}
I just want to set the deadline for function1.
Exits set_time_limit, but I think this deadline determines the full script any ideas?
set_time_limit () runs globally, but it can be reset locally.
Determine the number of seconds a script is allowed to run if it reaches, then the script returns a serious error. Default limit is 30 seconds or, if it exists, max_execution_time value defined in php.ini.
When called,
set_time_limit (
) restarts the timeout counter from zero. In other words, if the timeout is the default of 30 seconds, and in 25 seconds the call execution time is set_time_limit (20) in the script execution, the script will run for a total of 45 seconds out of time.
I did not test it, but you might be able to set it locally, when you
... Any time spent on such activity which is outside the execution of the script like system (), stream operation, database queries, Etc. Determine the maximum time the script is running when not included. It is not true on Windows where the measured time is real.
Comments
Post a Comment