betterSleep could take a really long time under linux
Status: Alpha
Brought to you by:
j_house
At midnight and at changes in the hour (such as daylight savings time), the call to time of day will return values that are different than expected.
If the goal end time is after the end of the day, it'll keep sleeping and never reach a time of day past the end of the day. For cases with daylight savings, it could end up sleeping for an hour longer than expected or suddenly finish sleeping on the hour.
Logged In: YES
user_id=1353569
Originator: YES
gettimeofday is really a misnomer. It gives the time since "start of epoch". That means that it'll only overflow in really rare circumstances. The timezone field is unused and daylight savings has no effect on its output. I've reduced the importance of this bug based on this new information.