downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Xhprof Funciones> <Constantes predefinidas
[edit] Last updated: Fri, 07 Jun 2013

view this page in

Ejemplos

Ejemplo #1 Ejemplo Xhprof con interfaz gráfica de usuario opcional

En este ejemplo se inicia y detiene el perfilador, a continuación, utiliza interfaz gráfica de usuario para guardar y analizar los resultados. En otras palabras, el código de la extensión se termina en la llamada a xhprof_disable() .

<?php
xhprof_enable
(XHPROF_FLAGS_CPU XHPROF_FLAGS_MEMORY);

for (
$i 0$i <= 1000$i++) {
    
$a $i $i;
}

$xhprof_data xhprof_disable();

$XHPROF_ROOT "/tools/xhprof/";
include_once 
$XHPROF_ROOT "/xhprof_lib/utils/xhprof_lib.php";
include_once 
$XHPROF_ROOT "/xhprof_lib/utils/xhprof_runs.php";

$xhprof_runs = new XHProfRuns_Default();
$run_id $xhprof_runs->save_run($xhprof_data"xhprof_testing");

echo 
"http://localhost/xhprof/xhprof_html/index.php?run={$run_id}&source=xhprof_testing\n";

?>

El resultado del ejemplo sería algo similar a:

http://localhost/xhprof/xhprof_html/index.php?run=t11_4bdf44d21121f&source=xhprof_testing


add a note add a note User Contributed Notes Ejemplos - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites