[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] [doc-en] master: Use milliseconds instead of seconds (#2113)
From:       USAMI Kenta via GitHub <noreply () php ! net>
Date:       2022-12-24 11:48:42
Message-ID: u2lo1U1uG22i1Se5bWYKabKhDExi0CVjgpNXTeVR5E () main ! php ! net
[Download RAW message or body]

Author: USAMI Kenta (zonuexe)
Committer: GitHub (web-flow)
Pusher: mumumu
Date: 2022-12-24T20:36:51+09:00

Commit: https://github.com/php/doc-en/commit/3441bb1c988fac320d7f436b2c06b88899a6b121
Raw diff: https://github.com/php/doc-en/commit/3441bb1c988fac320d7f436b2c06b88899a6b121.diff

Use milliseconds instead of seconds (#2113)

Changed paths:
  M  reference/misc/functions/usleep.xml


Diff:

diff --git a/reference/misc/functions/usleep.xml b/reference/misc/functions/usleep.xml
index 5e8a448bbe9..9a467f17ed5 100644
--- a/reference/misc/functions/usleep.xml
+++ b/reference/misc/functions/usleep.xml
@@ -63,13 +63,19 @@
 <?php
 
 // Current time
-echo date('h:i:s') . "\n";
+echo (new DateTime('now'))->format('H:i:s.v'), "\n";
 
-// wait for 2 seconds
-usleep(2000000);
+// wait for 2 milliseconds
+usleep(2000);
 
 // back!
-echo date('h:i:s') . "\n";
+echo (new DateTime('now'))->format('H:i:s.v'), "\n";
+
+// wait for 30 milliseconds
+usleep(30000);
+
+// back again!
+echo (new DateTime('now'))->format('H:i:s.v'), "\n";
 
 ?>
 ]]>
@@ -77,8 +83,9 @@ echo date('h:i:s') . "\n";
     &example.outputs;
     <screen>
 <![CDATA[
-11:13:28
-11:13:30
+11:13:28.005
+11:13:28.007
+11:13:28.037
 ]]>
     </screen>
    </example>

-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic