May 1, 1987
1:34 a.m.
Ignoring the coding and grammar errors in the Rationale, the big problem here is that code like the Rationale's
when = *localtime(now); when.tm_hour += 1; deadline = mktime(when);
printf("Loop will finish: %s\n", asctime(when)); while (difftime(time(0), deadline) > 0) whatever();
is *not* "a paradigm for continuing some loop for an hour." The code may continue for two hours (or not at all) if it is executed just before a daylight saving time transition.
How? deadline is a time_t (GMT) and so is time(0). Mark