Skip to content

Commit 78cf8fd

Browse files
committed
Use __CFTSRRate in __CFNanosecondsToTSR.
On Windows, __CFTSRRate is in units of 100 ns. To get a CFTimeInterval from mach_absolute_time therefore, we should divide by 1.0E7, not 1.0E9. But this suggests we should be dividing by __CFTSRRate anyway.
1 parent 1136a6e commit 78cf8fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CoreFoundation/RunLoop.subproj/CFRunLoop.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static inline uint64_t __CFNanosecondsToTSR(uint64_t ns) {
5252
#if TARGET_OS_MAC || TARGET_OS_LINUX
5353
return ns;
5454
#else
55-
CFTimeInterval ti = ns / 1.0E9;
55+
CFTimeInterval ti = ns / __CFTSRRate;
5656
return __CFTimeIntervalToTSR(ti);
5757
#endif
5858
}

0 commit comments

Comments
 (0)