Sleep: Difference between revisions

Jump to navigation Jump to search
737 bytes added ,  15 December 2022
Line 106: Line 106:
# print current unix timestamp
# print current unix timestamp
php -r 'echo microtime(TRUE) . PHP_EOL;'
php -r 'echo microtime(TRUE) . PHP_EOL;'
</pre>
Sleep couple microseconds. Tested on {{Mac}}
<pre>
# print current unix timestamp e.g. 1598346362244
Sleep couple microseconds. Tested on {{Mac}}
<pre>
# print current unix timestamp e.g. 1598346362244
php -r 'echo microtime(TRUE) . PHP_EOL;'
# sleep 1 millisecond = 0.001 seconds
sleep 0.001s
# print current unix timestamp
php -r 'echo microtime(TRUE) . PHP_EOL;'
</pre>
Sleep couple milliseconds (1 seconds = 1000 milliseconds) e.g. 1671090194.136471987
<pre>
# print current unix timestamp in milliseconds e.g. 1671090194.136471987
perl -MTime::HiRes=time -e 'printf "%.9f\n", time'
# sleep 1 millisecond = 0.001 seconds
sleep 0.001s
# print current unix timestamp
perl -MTime::HiRes=time -e 'printf "%.9f\n", time'
</pre>
</pre>


Anonymous user

Navigation menu