测试PHP程序运行时间

<?php  
    $stime=microtime(true); //获取程序开始执行的时间  
  
    echo "本PHP程序的运行时间为";  
  
    $etime=microtime(true);//获取程序执行结束的时间  
    $total=$etime-$stime;   //计算差值  
  
    $str_total = var_export($total, TRUE);  
    if(substr_count($str_total,"E")){  
        $float_total = floatval(substr($str_total,5));  
        $total = $float_total/100000;  
    echo "$total".'秒';  
    }  
?>    

你可能感兴趣的:(java,PHP)