The default script execution time-out in PHP is 30 seconds, if you haven't set it up for 30 seconds and if your script has not finished executing it will time out, let me give you a big explanation of how the PHP script executes the timeout.
The
Example of script execution time using microsecond in PHP, and microsecond in php
In PHP, most time formats are expressed in UNIX timestamps, while UNIX timestamps are measured in seconds with the smallest unit. This is not accurate enough for some
1. When optimizing the code, the execution time of the script is a very important consideration, so how to use PHP to calculate the running time of PHP script?
The following recommended to everyone a very useful class.
runtime.class.php
/*** PHP
Calculate Script Execution Time:#!/bin/bashUsetime () {Starttime= ' Date +%y%m%d-%h:%m 'starttime_s= ' Date +%s '$Command #根据自己脚本路径, test script File Execution time (SH test.sh)Endtime= ' Date +%y%m%d-%h:%m 'endtime_s= ' Date +%s 'sumtime=$[$endTime
This article mainly introduces the example of using the microsecond computing script execution time in PHP. This article first explains some knowledge about the microtime function and then provides a class for calculating the script running time,
The project takes a long time to process, it would have been like Java once the request will be processed, but the internship implementation of about 30 seconds or so the program is not executing.Later tossing and turning, finally found the reason,
//Modify the default time zone for PHPDate_default_timezone_get (' PRC ');//Use subtle calculation of PHP script execution timeEchoMicrotime ();Echo"returns the current UNIX timestamp and number of microseconds";Echo"";
Preface annual leave is coming soon. I want to do more work recently and help my tutor's company to tide over the difficulties.
AlgorithmOf
ArticleIt will be much less and may record some work gains. When I queried the database today, I felt that
Php:It is usually the beginning of the code you want to check to record a time, the end of the record a time. Take the difference value,the efficiency of database SQLSQL explain (MySQL), enable slow query log to record slow queries. Usually also
: This article mainly introduces the execution time of php computing scripts. For more information about PHP tutorials, see.
// Modify the default php time zone date_default_timezone_get ('prc'); // use the subtle calculation of the php script
1.php Execution Time:$begin=Microtime(true);//gets the time that the program started executing//some code here to execute$stop=Microtime(true);//gets the time that the program execution endedList($m 0,$s 0)=Explode(" ",$begin);List($m 1,$s
In PHP, most time formats are represented by a Unix timestamp, while the UNIX timestamp is the unit of measure time with a minimum of s (seconds). This is not accurate enough for some applications, so you can call Microtime () to return the current
google| Script | statistics | Executive
Class Php_timer Start
Class Php_timer {
Used to collect information during script execution
var $points = array ();
Call this function at the beginning of the script
function Start () {
Take a look at the
SyntaxHighlighter. all (); news & nbsp; | & nbsp; Security & nbsp; | & nbsp; Forum & nbsp; | & nbsp; download & nb
Addmarker ("Start");} // end function start () // call this function stop () at the end of the script () {// See the addmarker
Addmarker ("Start");} // end function start () // call this function stop () at the end of the script () {// see the addmarker function $ this-> addmarker ("Stop");} // end function stop () // This function is used to add a flag when the script is
(PHP 4, PHP 5)
Set_time_limit-set the maximum script execution timeDescription void
Set_time_limit(Int
$seconds)
Set the time allowed for script running, in seconds. If this setting is exceeded, the script returns a fatal error. The default value is
In PHP, most of the time formats are expressed in Unix timestamps, while the UNIX timestamp is the unit of time measured in s (seconds). This is not accurate enough for some applications, so you can call Microtime () to return the current UNIX
Welcome to the Oracle community forum and interact with 2 million technical staff. As we all know, the cache database query results can significantly shorten the script execution time and minimize the load on the database server. This technology is
PHP Intent: ini_set-setting values for a system configuration item
Basic information:String ini_set (String $varname, String $newvalue).(Description: Sets the value for the specified configuration option.) This option keeps the new value when
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.