1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/hrtime/examples.xml
Pedro Antonio Gil Rodríguez 4a96e7e8db Actualización a la última versión
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@335157 c90b9560-bf6c-de11-be94-00142212c4b1
2014-11-03 19:28:37 +00:00

65 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: cb2e7b70b1354e5468e538720d59c37e273bc98e Maintainer: seros Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="hrtime.examples" xmlns="http://docbook.org/ns/docbook">
&reftitle.examples;
<section xml:id="hrtime.example.basic">
<title>Uso básico</title>
<para>
El ejemplo muestra el uso básico de la clase StopWatch
</para>
<example>
<title>Medir la ejecución de varios bloques de código y obtener el total</title>
<programlisting role="php">
<![CDATA[
<?php
$c = new HRTime\StopWatch;
$c->start();
/* medir la ejecución de este bloque de código */
for ($i = 0; $i < 1024*1024; $i++);
$c->stop();
$transcurrido0 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND);
/* la medición no se ejecuta aquí */
for ($i = 0; $i < 1024*1024; $i++);
$c->start();
/* medir la ejecución de este bloque de código */
for ($i = 0; $i < 1024*1024; $i++);
$c->stop();
$transcurrido1 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND);
$total_transcurrido = $c->getElapsedTime(HRTime\Unit::NANOSECOND);
?>
]]>
</programlisting>
</example>
</section>
</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
-->