Aymen++
05-15-2004, 03:06 PM
how can i measure the speed of the performance of php?
|
||||
php performanceAymen++ 05-15-2004, 03:06 PM how can i measure the speed of the performance of php? raf 05-15-2004, 05:00 PM by inserting a timer. example //first a little function to compute the elapsed time function microtime_diff($a, $b) { list($a_dec, $a_sec) = explode(" ", $a); list($b_dec, $b_sec) = explode(" ", $b); return $b_sec - $a_sec + $b_dec - $a_dec; } //then insert this at the startpoint $start_time = microtime(); //then your code you wan't to clock for ($i = 0; $i<=100000; $i++){} // then the endpoint and print $duration = microtime_diff($start_time, microtime()); echo ('100 000 incrementations took ' . sprintf("%0.3f", $duration) . ' seconds'); |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum