【PHP】下らねぇ質問 ..
194:nobodyさん
09/04/10 13:04:28
// テスト用変数
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);
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5493日前に更新/76 KB
担当:undef