Php set_time_limit function instance

Source: Internet
Author: User

Parameter or set_time_limit
(PHP 4 and PHP 5)

The parameter or set_time_limit-limits the maximum execution time.

Description
Invalid parameter or set_time_limit (seconds)
Set the number of seconds for the script to run. If this is done, the script returns a fatal error. The default limit is 30 seconds. If it exists, max_execution_time value is defined in php. ini.

If required, the timeout counter for parameter or set_time_limit () restart is zero. In other words, if the timeout value is 30 seconds by default, the script is executed from 25 seconds to 20 seconds, for example, when the parameter or set_time_limit (20) is used, the script will run, a total of 45 seconds before.

Parameters

Seconds
Maximum running time in seconds. If it is set to zero, there is no time limit.


Return value
Returns without value.

Note
Warning
This function does not affect PHP running in safe mode. There is no feasible way to disable the security mode or change the time limit in php. ini.

Note: the parameter or set_time_limit () function and the configuration command max_execution_time not only affect the script of the execution time. Any activity other than time occurs when the script executes the system call, such as using the system (), stream service, database query, and other scripts that are not included in a specified maximum time has been run. This is incorrect. The measurement time in Windows is true.

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.