Your sleep code is extremely fragile against DST Changes. Imagine what happens when it comes a DST -1h change (from summer time to Winter time) during your while loop. Whoops, the code will instead wait 1 hour and 7 seconds.
No, his code uses time from Time::HiRes, which is similiar to time, both are
seconds since the epochwhich is independent from any time zone and their changes …
In reply to Re^5: How I unconditionally wait for data in 7 seconds?
by soonix
in thread How I unconditionally wait for data in 7 seconds?
by sebastiannielsen2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |