aidan           Mon Oct  4 02:26:48 2004 EDT

  Modified files:              
    /phpdoc/en/reference/misc/functions time-nanosleep.xml 
  Log:
  Fixed amount of 0's on nanoseconds
  
http://cvs.php.net/diff.php/phpdoc/en/reference/misc/functions/time-nanosleep.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/misc/functions/time-nanosleep.xml
diff -u phpdoc/en/reference/misc/functions/time-nanosleep.xml:1.3 
phpdoc/en/reference/misc/functions/time-nanosleep.xml:1.4
--- phpdoc/en/reference/misc/functions/time-nanosleep.xml:1.3   Tue Aug 10 14:47:24 
2004
+++ phpdoc/en/reference/misc/functions/time-nanosleep.xml       Mon Oct  4 02:26:48 
2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <refentry id="function.time-nanosleep">
  <refnamediv>
   <refname>time_nanosleep</refname>
@@ -64,26 +64,24 @@
     <programlisting role="php">
 <![CDATA[
 <?php
-/* Careful! This won't work as expected if an array is returned */
-if (time_nanosleep(0, 500000)) {
+// Careful! This won't work as expected if an array is returned
+if (time_nanosleep(0, 500000000)) {
     echo "Slept for half a second.\n";
 }
 
-/* This is better: */
-if (time_nanosleep(0, 500000) === true) {
+// This is better:
+if (time_nanosleep(0, 500000000) === true) {
     echo "Slept for half a second.\n";
 }
 
-/* And this is the best: */
+// And this is the best:
 $nano = time_nanosleep(2, 100000);
 
 if ($nano === true) {
     echo "Slept for 2 seconds, 100 milliseconds.\n";
-}
-else if ($nano === false) {
+} elseif ($nano === false) {
     echo "Sleeping failed.\n";
-}
-else if (is_array($nano)) {
+} elseif (is_array($nano)) {
     $seconds = $nano['seconds'];
     $nanoseconds = $nano['nanoseconds'];
     echo "Interrupted by a signal.\n";

Reply via email to