blob: 164cce369ba19f16332a668520697d07bba61629 [file] [log] [blame]
diff -aruN nspr-4.8.6/mozilla/nsprpub/pr/src/md/unix/unix.c nspr-4.8.6.N/mozilla/nsprpub/pr/src/md/unix/unix.c
--- nspr-4.8.6/mozilla/nsprpub/pr/src/md/unix/unix.c 2010-02-09 19:03:35.000000000 -0800
+++ nspr-4.8.6.N/mozilla/nsprpub/pr/src/md/unix/unix.c 2011-04-15 11:10:27.000000000 -0700
@@ -3026,12 +3026,21 @@
PRIntervalTime _PR_UNIX_GetInterval()
{
+#if defined(XP_MACOSX)
struct timeval time;
PRIntervalTime ticks;
(void)GETTIMEOFDAY(&time); /* fallicy of course */
ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC; /* that's in milliseconds */
ticks += (PRUint32)time.tv_usec / PR_USEC_PER_MSEC; /* so's that */
+#else
+ struct timespec time;
+ PRIntervalTime ticks;
+
+ (void)clock_gettime(CLOCK_MONOTONIC, &time);
+ ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC; /* that's in milliseconds */
+ ticks += (PRUint32)((PRUint64)time.tv_nsec / PR_NSEC_PER_MSEC); /* so's that */
+#endif
return ticks;
} /* _PR_SUNOS_GetInterval */