- 194 名前:nobodyさん mailto:sage [2009/04/10(金) 13:04:28 ID:???]
- // テスト用変数
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);
|

|