Home > Backend Development > PHP Tutorial > How to calculate the execution time of a program_PHP Tutorial

How to calculate the execution time of a program_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:52:19
Original
852 people have browsed it

function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec (float)$sec);
}

$time_start = getmicrotime();//Start timing and place it in the program header

for ($i=0; $i < 1000; $i ){
//do nothing, 1000 times
}

$time_end = getmicrotime();//End timing and put it at the end
$time = $time_end - $time_start;

echo "Did nothing in $time seconds";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632500.htmlTechArticlefunction getmicrotime(){ list($usec, $sec) = explode( ,microtime()); return ( (float)$usec (float)$sec); } $time_start = getmicrotime();//Start timing and put it in the program header for ($i=0; $i...
Statement of this Website
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
Latest Issues
Framework error
From 1970-01-01 08:00:00
0
0
0
Can anyone help me take a look?
From 1970-01-01 08:00:00
0
0
0
Composer cannot install laravel
From 1970-01-01 08:00:00
0
0
0
homestead - laravel new app reports error
From 1970-01-01 08:00:00
0
0
0
composer installation failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template