Hi,
musst Du aber eventuell noch verfeinern - zb. Textausgaben etc.
Habe mal 2 For-Schleifen als Beispiel genommen.
PHP-Code:
<?php
function startTime() {
list($mic, $sec) = split(" ", microtime());
$time = $sec + $mic;
return $time;
}
function nextTime($begin,$string) {
list($mic, $sec) = split(" ", microtime());
$time = $sec + $mic;
$end = $time - $begin;
printf("%s (%8.4f)<br>", $string, $end);
flush();
return $time;
}
// Start
$time = startTime();
for($x=0;$x<1000;$x++){
$y = $x;
}
// 1.Zeit
$time = nextTime($time, "1.Zeit");
for($x=0;$x<100000;$x++){
$y = $x;
}
// 2.Zeit
$time = nextTime($time, "2.Zeit");
?>
Bye Damir
P.S. Das waere doch was fuer die Rubrik Tipps&Tricke (
http://www.selfphp.info/tipps_tricks/index.php)