<?php $pagestartime =microtime(); ?> <?php 程序段?> <?php $pageendtime = microtime(); echo $pageendtime . "<br/>" ; $starttime = explode ( " " , $pagestartime ); $endtime = explode ( " " , $pageendtime ); $totaltime = $endtime [0]- $starttime [0]+ $endtime [1]- $starttime [1]; $timecost = sprintf( "%s" , $totaltime ); echo "页面运行时间: $timecost 秒" ; ?> |