"; $GLOBALS['start_timer'] = time(); function getBenchmark($text='') { if (!empty($text)) echo $text . "\n"; list($a, $b) = explode(' ', microtime()); $time = $a + $b; $diff = 0; if (isset($GLOBALS['prec_timer'])) $diff = $time - $GLOBALS['prec_timer']; $memory = memory_get_usage(); $mdiff = 0; if (isset($GLOBALS['prec_memory'])) $mdiff = $memory - $GLOBALS['prec_memory']; echo "Mémoire: ".($memory/1000)." Ko (+".($mdiff/1000)." Ko)\n"; echo "Temps: ".($time - $GLOBALS['start_timer'])." (+".round($diff,3).")\n"; echo "\n"; $GLOBALS['prec_timer'] = $time; $GLOBALS['prec_memory'] = $memory; } ?>