<?php
$t1=microtime(true); //獲取程序1,開始的時間
程序1(代碼。。。)
$t2=microtime(true); //獲取程序1,結束的時間
$t3=microtime(true); //獲取程序2,開始的時間
程序1(代碼。。。)
$t4=microtime(true); //獲取程序2,結束的時間
$time1=$t2-$t1;
$time2=$t4-$t3;
比較$time 和$time 從而比較兩個程序的運行時間。
?>
<?php
$t1=microtime(true); //獲取程序1,開始的時間
程序1(代碼。。。)
$t2=microtime(true); //獲取程序1,結束的時間
$t3=microtime(true); //獲取程序2,開始的時間
程序1(代碼。。。)
$t4=microtime(true); //獲取程序2,結束的時間
$time1=$t2-$t1;
$time2=$t4-$t3;
比較$time 和$time 從而比較兩個程序的運行時間。
?>
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。