Closed Bug 541185 Opened 10 years ago Closed 10 years ago

POSIX-clock TimeStamp should better deal with low-resolution "HW" clocks

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.3a3

People

(Reporter: cjones, Assigned: cjones)

References

Details

Attachments

(1 file)

In writing this code, I assumed that the time for a syscall (or vsyscall) was greater than the clock's actual resolution.  On Neil's VM, the actual clock resolution is 10ms, which breaks this assumption.  Neil says that his clock_getres() reports 10ms, which suggests the following modified algorithm:

  (1) Run current algorithm.  If |candidate| is > 0ns, stop.
  (2) |candidate == 0ns| => impossibly-high-resolution or low-resolution.  Ask clock_getres().  If clock_getres() > 0ns, stop.
  (3) Set resolution to 1ms (NSPR fallback).

Pretty simple modification.
Version: unspecified → Trunk
http://hg.mozilla.org/mozilla-central/rev/cdc530fc500e
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Duplicate of this bug: 549178
Target Milestone: --- → mozilla1.9.3a3
You need to log in before you can comment on or make changes to this bug.