Home > Article > Backend Development > php set_time_limit() sets page execution time_PHP tutorial
The set_time_limit function can temporarily define the execution time of your current page. When set_time_limit(0), the page will be valid forever until the program execution is completed. Let me introduce the usage of set_time_limit.
Syntax: void set_time_limit (int seconds)
Note: When PHP is running in safe mode, set_time_limit() will have no results unless safe mode is turned off or the structure file is modified (called php3.ini in PHP3 and php.ini in PHP4 ) time limit.
Example
The code is as follows
|
Copy code
|
||||
When this function is called, set_time_limit() will restart the timeout counter from zero. In other words, if the default timeout is 30 seconds and set_time_limit(20) is called when the script has been running for 25 seconds, then the total time the script can run before timing out is 45 seconds. Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn Previous article:Detailed explanation of global variables in PHP_PHP tutorialNext article:Detailed explanation of global variables in PHP_PHP tutorial Related articlesSee more |