Opened 21 years ago
Closed 17 years ago
#74 closed Bugs (None)
timeconv.inl to_duration() nsec error
| Reported by: | cpqlvc | Owned by: | martin_wille |
|---|---|---|---|
| Milestone: | Component: | None | |
| Version: | None | Severity: | |
| Keywords: | Cc: |
Description
The computation for number of milliseconds to
Sleep() reads
milliseconds = static_cast<unsigned>(((xt.sec -
cur.sec) * MILLISECONDS_PER_SECOND) +
(((xt.nsec - cur.nsec) +
(NANOSECONDS_PER_MILLISECOND/2)) /
NANOSECONDS_PER_MILLISECOND));
This computation is incorrect when xt.sec > cur.sec,
but xt.nsec < cur.nsec. For example
xt.sec = 1019600872
xt.nsec = 44320000
cur.sec = 1019600871
cur.nsec = 977320000
Change History (2)
comment:2 by , 17 years ago
| Status: | assigned → closed |
|---|
Logged In: YES user_id=592361 I copied the fix from to_duration to to_microduration(). The duplicate function call had been removed before. This should fix the problems reported in this thread. The potential for some code cleanup remains.
Note:
See TracTickets
for help on using tickets.
