summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfasttimer.h
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-26 12:35:22 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-26 12:35:22 -0800
commitb77fe6dc724c162b3de194d1b3f362ac4c7f5021 (patch)
tree6534b694c2334661013898160033f9d0bcae02df /indra/llcommon/llfasttimer.h
parent3d771ed88b1f40ca0a5869530d729a58000ef028 (diff)
DEV-45468 SNOW-108: Fast timers are broken / badly-scaled on linux
more reliable fix based on feedback from Richard. dicked with the Darwin results too since those seemed wrong based on the same feedback (also covered in test plan).
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rw-r--r--indra/llcommon/llfasttimer.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 32f3561616..48461df6ae 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -113,7 +113,7 @@ inline U64 LLFastTimer::getCPUClockCount64()
struct timespec tp;
#ifdef CLOCK_MONOTONIC // MONOTONIC supported at build-time?
- if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime, try REALTIME
+ if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime then ouch, try REALTIME
#endif
clock_gettime(CLOCK_REALTIME,&tp);
@@ -122,7 +122,7 @@ inline U64 LLFastTimer::getCPUClockCount64()
inline U32 LLFastTimer::getCPUClockCount32()
{
- return (U32)LLFastTimer::getCPUClockCount64();
+ return (U32)(LLFastTimer::getCPUClockCount64() >> 8);
}
#endif // (LL_LINUX || LL_SOLARIS))
@@ -134,14 +134,14 @@ inline U32 LLFastTimer::getCPUClockCount32()
{
U64 x;
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
- return (U32)x >> 8;
+ return (U32)(x >> 8);
}
inline U64 LLFastTimer::getCPUClockCount64()
{
U64 x;
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
- return x >> 8;
+ return x;
}
#endif
@@ -154,7 +154,7 @@ inline U64 LLFastTimer::getCPUClockCount64()
inline U32 LLFastTimer::getCPUClockCount32()
{
- return (U32)get_clock_count();
+ return (U32)(get_clock_count()>>8);
}
inline U64 LLFastTimer::getCPUClockCount64()