楼主是想要查询一个页面的执行时间吧?
给你个例子你看一下就明白了function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}function etime(){
global  $time_start;
$time_end = microtime_float();
$time = number_format(($time_end - $time_start) * 1000,6);
return "执行".$sql."耗时:".$time."ms";
}
$time_start = microtime_float();
$oldtime = time() - ( 7 * 24 * 60 * 60);
$ontime = date("Y-m-d");
$endtime = etime();echo $ontime."<br>";echo $endtime;