Php set_time_limit () function

Source: Internet
Author: User

Set_time_limit favorites
Syntax: void set_time_limit (int seconds)

Note:

Set the number of seconds that a program can run. If the time limit is reached, the program will return an error. The default limit time is 30 seconds. The value of max_execution_time is defined in the structure file (php3.ini in PHP3 and php in PHP4. ini). If the number of seconds is set to 0, there is no time limit.

When you call this function, set_time_limit () calculates the maximum execution time from scratch. That is, if the maximum execution time is 30 seconds, however, if it takes 25 seconds to execute the program before calling set_time_limit (20), the maximum program execution time will be 45 seconds.

Note: When PHP is executed in safe mode, set_time_limit () will not produce any results, unless it is disabled in safe mode or modified in the structure file (in PHP3, it is called php3.ini, PHP4 is called php. ini.
Example:

Set_time_limit (1000)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.