Home >php教程 >php手册 >php学习之计算程序运行的时间

php学习之计算程序运行的时间

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:37:01880browse

php学习之计算程序运行的时间


function gettime(){
$starttime=microtime(true); //获取程序开始执行的时间
mt_rand(1,10); //你执行的代码 liehuo。net
$endtime=microtime(true);//获取程序执行结束的时间
$total=$endtime-$starttime; //计算差值
return $total;
}
echo gettime();
?>

原文地址:http://www.52blogger.com/archives/5

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