【PHP】下らねぇ質問はID出して書き込みやがれ 83
■ このスレッドは過去ログ倉庫に格納されています
0194nobodyさん
2009/04/10(金) 13:04:28ID:???function testAry() {for($a=0;$a<100;$a++) $h[]=$i;return $h;}
// タイム測定
function bench() {return microtime(true);}
// ベンチマーク表示
function cale($time) {
echo "<pre>";print_r($time);echo "</pre>";
foreach($time as $t) {echo "<p>".($t[1]-$t[0])."</p>";}
}
// --------- 比較コード ---------------- */
$time[0][0]=bench();
$test = array();
$cnt=count(testAry());
for($i=0; $i<$cnt; $i++) {$test[]=$i;}
$time[0][1]=bench();
// ---------- 175のコード ------------- */
$time[1][0]=bench();
$test = array();
for ($i=0; $i<count(testAry()); $i++) {$test[]=$i;}
$time[1][1]=bench();
/* ---------- ここまで ---------------- */
cale($time);
■ このスレッドは過去ログ倉庫に格納されています