diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-04-19 18:02:56 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-04-19 18:02:56 -0700 |
commit | 41357bb01297ce0977da7a3e2e9308d3c903d3a8 (patch) | |
tree | cf677aea0a81ecddbb394e64c9bd07db517880af /indra/llcommon/llfasttimer.h | |
parent | c3fa45282f5bdb0cb7a3fcd680154e88cafde4bb (diff) | |
parent | 3a7490e492b35d5dc55f6124d2e1acbca3bd4d79 (diff) |
Automated merge with ssh://hg.lindenlab.com/q/viewer-hotfix
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rw-r--r-- | indra/llcommon/llfasttimer.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 48461df6ae..840d09d970 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -36,6 +36,10 @@ // pull in the actual class definition #include "llfasttimer_class.h" +// +// Important note: These implementations must be FAST! +// + #if LL_WINDOWS // // Windows implementation of CPU clock @@ -99,15 +103,17 @@ inline U64 LLFastTimer::getCPUClockCount64() #endif -#if LL_LINUX || LL_SOLARIS +#if (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__)) // -// Linux and Solaris implementation of CPU clock - all architectures. +// Linux and Solaris implementation of CPU clock - non-x86. +// This is accurate but SLOW! Only use out of desperation. // // Try to use the MONOTONIC clock if available, this is a constant time counter -// with nanosecond resolution (but not necessarily accuracy) and attempts are made -// to synchronize this value between cores at kernel start. It should not be affected -// by CPU frequency. If not available use the REALTIME clock, but this may be affected by -// NTP adjustments or other user activity affecting the system time. +// with nanosecond resolution (but not necessarily accuracy) and attempts are +// made to synchronize this value between cores at kernel start. It should not +// be affected by CPU frequency. If not available use the REALTIME clock, but +// this may be affected by NTP adjustments or other user activity affecting +// the system time. inline U64 LLFastTimer::getCPUClockCount64() { struct timespec tp; @@ -124,12 +130,12 @@ inline U32 LLFastTimer::getCPUClockCount32() { return (U32)(LLFastTimer::getCPUClockCount64() >> 8); } -#endif // (LL_LINUX || LL_SOLARIS)) +#endif // (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__)) -#if (LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) +#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) // -// Mac x86 implementation of CPU clock +// Mac+Linux+Solaris FAST x86 implementation of CPU clock inline U32 LLFastTimer::getCPUClockCount32() { U64 x; |