Home Sign up   |   Sign in

计算php脚本执行时间

2009-06-26 10:10:44   Comments (0)   Views (146)   php

函数声名如下:

<?php
function getmicrotime(){
list($usec, $sec) = explode("   ",microtime());
return ((float)$usec + (float)$sec);
}
?>

<?php
$time_start = getmicrotime();
//要执行的脚本........
$time_end =   getmicrotime();
$time = $time_end - $time_start;
echo   "<p><hr>用时:".$time."<hr>";
?>

Tags:   

Comments list

Leave a Comment

Name
Content
Verification Type the characters you see in the picture below