-
-
Notifications
You must be signed in to change notification settings - Fork 422
Open
Labels
C-timeIssues and PRs about C/C++ methods, headers and data types dealing with timeIssues and PRs about C/C++ methods, headers and data types dealing with timeportabilityWe want NUT to build and run everywhere possibleWe want NUT to build and run everywhere possible
Milestone
Description
The https://www.gnu.org/software/libc/manual/html_node/Calculating-Elapsed-Time.html document suggests that there may be systems which account struct timeval fields tv_sec/tv_usec as unsigned values, so under-flows are possible when subtracting times from each other. The sample method from that document was adapted as difftimeval() in #1936; possibly the original method is also desirable to replace our loops currently similar to this:
tv.tv_usec -= difftimeval(now, start);
while (tv.tv_usec < 0) {
tv.tv_sec--;
tv.tv_usec = 1000000 + tv.tv_usec; // Note it is negative
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-timeIssues and PRs about C/C++ methods, headers and data types dealing with timeIssues and PRs about C/C++ methods, headers and data types dealing with timeportabilityWe want NUT to build and run everywhere possibleWe want NUT to build and run everywhere possible