mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@307376 c90b9560-bf6c-de11-be94-00142212c4b1
155 lines
3.6 KiB
XML
155 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 6ef46c971edd862c39d3b30513e549dacc735e04 Maintainer: seros Status: ready -->
|
|
<refentry xml:id="function.sleep" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>sleep</refname>
|
|
<refpurpose>Retrasar la ejecución</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>sleep</methodname>
|
|
<methodparam><type>int</type><parameter>seconds</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Retrasa la ejecución del programa durante el número de segundos dados por
|
|
<parameter>seconds</parameter>.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>seconds</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El tiempo de parada en segundos.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve cero en caso de éxito, o &false; en caso de error.
|
|
</para>
|
|
<para>
|
|
Si la llamada se interrumpió por una señal, <function>sleep</function> devuelve
|
|
un valor distinto de cero. En Windows, este valor será siempre
|
|
<literal>192</literal> (el valor de la constante
|
|
<constant>WAIT_IO_COMPLETION</constant> dentro de la API de Windows).
|
|
En otras plataformas, el valor devuelto será el número de segundos que quedan para
|
|
dormir.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Si el número de segundos especificado por <parameter>seconds</parameter> es negativo,
|
|
esta función generará un error de nivel <constant>E_WARNING</constant>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.3.4</entry>
|
|
<entry>
|
|
Antes de PHP 5.3.4, en Windows, <function>sleep</function> siempre
|
|
devuelve &null; cuando el sueño ha sucedido, si tener en cuenta si el
|
|
sueño fue interrumpido o no.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>sleep</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// hora actual
|
|
echo date('h:i:s') . "\n";
|
|
|
|
// dormir durante 10 segundos
|
|
sleep(10);
|
|
|
|
// ¡despierta!
|
|
echo date('h:i:s') . "\n";
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Este ejemplo imprimirá (después de 10 segundos)
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
05:31:23
|
|
05:31:33
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>usleep</function></member>
|
|
<member><function>time_nanosleep</function></member>
|
|
<member><function>time_sleep_until</function></member>
|
|
<member><function>set_time_limit</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- 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
|
|
-->
|