didou Tue Aug 19 11:40:05 2003 EDT Modified files: /phpdoc/en/reference/misc/functions sleep.xml Log: adding example Index: phpdoc/en/reference/misc/functions/sleep.xml diff -u phpdoc/en/reference/misc/functions/sleep.xml:1.5 phpdoc/en/reference/misc/functions/sleep.xml:1.6 --- phpdoc/en/reference/misc/functions/sleep.xml:1.5 Sat Jun 21 06:28:05 2003 +++ phpdoc/en/reference/misc/functions/sleep.xml Tue Aug 19 11:40:05 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/misc.xml, last change in rev 1.2 --> <refentry id="function.sleep"> <refnamediv> @@ -16,6 +16,36 @@ The <function>sleep</function> function delays program execution for the given number of <parameter>seconds</parameter>. </simpara> + <para> + <example> + <title><function>sleep</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// current time +echo date('h:i:s') . "\n"; + +// sleep for 10 seconds +sleep(10); + +// wake up ! +echo date('h:i:s') . "\n"; + +?> +]]> + </programlisting> + <para> + This example will output (after 10 seconds) + </para> + <screen> +<![CDATA[ +05:31:23 +05:31:33 +]]> + </screen> + </example> + </para> <simpara> See also <function>usleep</function> and <function>set_time_limit</function>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php