summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfasttimer.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-11-30 15:38:19 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-11-30 15:38:19 -0500
commited64630a67c2c216c369099532323cab2e251cab (patch)
treef2614b1a411f5033026e2ab390512534db7cc7c4 /indra/llcommon/llfasttimer.h
parent7166b4009f738281cfacbb9b5810dfba360ec2fd (diff)
Use architecture-independent code for windows fast timers
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rwxr-xr-x[-rw-r--r--]indra/llcommon/llfasttimer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 4ff93a553c..5c2df877b0 100644..100755
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -64,6 +64,7 @@
// shift off lower 8 bits for lower resolution but longer term timing
// on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing
+#ifdef USE_RDTSC
inline U32 LLFastTimer::getCPUClockCount32()
{
U32 ret_val;
@@ -94,6 +95,20 @@ inline U64 LLFastTimer::getCPUClockCount64()
}
return ret_val;
}
+#else
+LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp
+// These use QueryPerformanceCounter, which is arguably fine and also works on amd architectures.
+inline U32 LLFastTimer::getCPUClockCount32()
+{
+ return (U32)(get_clock_count()>>8);
+}
+
+inline U64 LLFastTimer::getCPUClockCount64()
+{
+ return get_clock_count();
+}
+#endif
+
#endif