24 ms·
Many solutions, e.g. make sleep 0.9 sec, i.e. less than period to guarantee entering the critical 1 second span at least once.
by udev 11y ago
Many solutions, e.g. make sleep 0.9 sec, i.e. less than period to guarantee entering the critical 1 second span at least once.
- jerf 11y agoEven if you set the interval to the minimum possible, there is no upper bound on how long it may take to complete, or indeed, any guarantee that it will complete. In this case it doesn't matter, but I point this out because I've seen people trying to use this sort of logic in places where it does matter in the last three months.
- JonnieCache 11y agoYou're talking about `sleep` specifically here, right? Or general use of timers/polling for flow control?
- dllthomas 11y agoI think it's "testing equality in timers that aren't guaranteed to fire inside any particular bound".
- ultramancool 11y agoIf they'd just switched it to greater than and used a unix timestamp...
- dllthomas 11y ago[ $(date +%s) -ge $(date +%s -d"Sat Oct 31 16:00:00 EDT 2015") ]