Another reason is that sleep(0.1); is silently accepted now (even with strict types enabled),
That appears to not be true: https://3v4l.org/7YbqX

corrected, should be "without strict types enabled" -
https://3v4l.org/A2olN "even with strict type enabled" statement in BC section remains valid
Having a function that behaves differently based on different platforms is a 
bad idea.

I will implement fallback to usleep. I have not noticed any issues with
usleep availability. Is there any known platform without nanosleep
neither usleep support?
With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,

Michael Voříšek

On 11 Aug 2020 12:39, Dan Ackroyd wrote:

Michael Voříšek wrote:

Another reason is that sleep(0.1); is silently accepted now (even with
strict types enabled),

That appears to not be true: https://3v4l.org/7YbqX

Rowan wrote:
Unless there are problems with the implementation, this seems like a
straight-forward win.

From the PR.
Implemented using nanosleep which is not guaranteed to be available everywhere.

Please just use usleep if you need more accuracy than seconds.

Having a function that behaves differently based on different
platforms is a bad idea.

Changing a function to have surprising behaviour just to avoid using a
different function, that is already available, is a really bad
tradeoff.

cheers
Dan
Ack

Reply via email to