Closed Bug 194989 Opened 22 years ago Closed 11 years ago

Use more efficient PRIntervalTime measurement on Mac OS X

Categories

(NSPR :: NSPR, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 757593

People

(Reporter: sfraser_bugs, Assigned: wtc)

Details

Mac OS X currently uses gettimeofday() for measuring interval time units. This is probably much slower than using UpTime(), or mach_absolute_time().
Summary: Use more efficient PRInterval measurement on Mac OS X → Use more efficient PRIntervalTime measurement on Mac OS X
Ideally we should read the "time base" in PowerPC processors. We will need to make sure that threads running on different processors in a multiprocessor system have a consistent interval timer.
I think both UpTime() and mach_absolute_time() are using the CPU timebase. I'm not sure what we need to do to ensure consistency between CPUs.
I've been informed (on the darwin mailing list) that mach_absolute_time() will give consistent results on dual CPU systems. Things would be pretty hosed if it didn't.
QA Contact: wtchang → nspr
While looking around for time-related bugs I came across this (very old) one which has already been fixed so I'm closing it as a duplicate of the relevant bug.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.