mirror of
https://github.com/php/doc-ru.git
synced 2026-03-26 08:42:13 +01:00
66 lines
2.0 KiB
XML
66 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: 991e1abe02858003596f9ee586c2bd1edf58457c Maintainer: rjhdby Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
|
||
<chapter xml:id="xhprof.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
&reftitle.examples;
|
||
<example>
|
||
<title>Примеры использования Xhprof, опционально с GUI</title>
|
||
<para>
|
||
В этом примере профайлер запускается, останавливается и использует
|
||
встроенный GUI интерфейс для сохранения и разбора результатов.
|
||
Другими словами, исполнение кода модуля завершается
|
||
на функции <function>xhprof_disable</function>.
|
||
</para>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?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";
|
||
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs.similar;
|
||
<screen>
|
||
<![CDATA[
|
||
http://localhost/xhprof/xhprof_html/index.php?run=t11_4bdf44d21121f&source=xhprof_testing
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</chapter>
|
||
<!-- Keep this comment at the end of the file
|
||
Local variables:
|
||
mode: sgml
|
||
sgml-omittag:t
|
||
sgml-shorttag:t
|
||
sgml-minimize-attributes:nil
|
||
sgml-always-quote-attributes:t
|
||
sgml-indent-step:1
|
||
sgml-indent-data:t
|
||
indent-tabs-mode:nil
|
||
sgml-parent-document:nil
|
||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||
sgml-exposed-tags:nil
|
||
sgml-local-catalogs:nil
|
||
sgml-local-ecat-files:nil
|
||
End:
|
||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||
vim: et tw=78 syn=sgml
|
||
vi: ts=1 sw=1
|
||
-->
|