Post #572185
2026-02-17 19:36 UTC
Replies (6)
-
@bobmagicii@phpc.social 2026-02-17 21:57
@flowcontrol@phpc.social to this day i still have that initial sense of wonder the first time i accidentally observed it
-
@bryanredeagle@beige.party 2026-02-17 22:47
@flowcontrol@phpc.social I never trust anything time based. It's all just pretty close enough in my book.
-
@edorian@phpc.social 2026-02-18 01:47
@flowcontrol@phpc.social my assumption is that it is just a sleep(3) wrapper and works like it
-
@jaapio@phpc.social 2026-02-18 05:20
@flowcontrol@phpc.social sleep is always fuzzy. Depending on the implementation it can be very strange. Especially with low numbers, and developers trying to be smart to make the sleep more precise.
-
@dseguy@phpc.social 2026-02-18 09:53
@flowcontrol@phpc.social I suspect sleep() relies on the internal clock, which might be changed at any moment. But I have never observed it. I think hrtime() works better for that, and is system immune. All in all, this looks like something going to the php-tips archive :)
-
@paranoiq@witter.cz 2026-02-18 15:17
@flowcontrol@phpc.social sleap() returns earlier, if interrupted with a signal. you need to handle signals and call sleap again with the rest of planned sleap interval