On November 12, 2003 06:34 pm, Moriyoshi Koizumi wrote:MoriyoshiIn my opinion as a user, I would say allow sleep() to accept floats, and depreciate usleep(). If sleep() is implemented with nanosleep() anyway, is there a point to having both?
I think it'd rather belong to a matter of stupidity that the user has to
choose the available function in order to accomplish a common purpose.
Actually they don't act like one another though.
Well, the 3 sleep functions we now have are actually quite different. sleep() offers a basic second based functionality. As far as glibc goes sleep() on many platforms is implemented using nanosleep().
usleep() allows sleeping at 1/1,000,000 intervals
nanosleep() allows an easy way to sleep for given amount of seconds and sleep precision of up to 1/1,000,000,000 of a second. In addition allowing you to resume sleep if it was interrupted by a signal.
To me it seems like each of the 3 functions offer distinct functionality and the user now has greater flexibility, when it comes to pausing their scripts.
Ilia
If you allow sleep() to accept floats, people using integers will still have support anyway. The only people that require adjusting their code eventually once usleep() is depreciated will be the ones using usleep().
Nathan
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php