int|float for sleep? sleep(0.1) => sleep 0.1 seconds
| From: | Hans Henrik Bergan | Date: | Thu, 15 Feb 2024 18:20:58 +0000 |
| Subject: | int|float for sleep? sleep(0.1) => sleep 0.1 seconds | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-122388@lists.php.net to get a copy of this message | ||
Can we make sleep accept int|float?
Made a PR: https://github.com/php/php-src/pull/13401
For years when I wanted to sleep for 0.1 seconds, it annoyed me that I
couldn't do
sleep(0.1);
instead I had to do
`usleep(figure out how many microseconds there are in 0.1 seconds and put
it here);`
FWIW Python's time.sleep also works like this:
https://docs.python.org/3/library/time.html#time.sleep