summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfasttimer.h
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-06-24 17:25:25 +0800
committerErik Kundiman <erik@megapahit.org>2025-06-24 17:25:25 +0800
commita20bf9a72365142e6a534180c375221c100d7c54 (patch)
treed61346da0fe492a2a82f0673d49ad298eb990b3a /indra/llcommon/llfasttimer.h
parentd1353441f91d5776e1f4e72666f7c9de96eecca5 (diff)
parent09615bb5160d6ab67f027409ec6be25336842ab7 (diff)
Merge branch 'main' into gltf_mesh_import
Diffstat (limited to 'indra/llcommon/llfasttimer.h')
-rw-r--r--indra/llcommon/llfasttimer.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index a69a03e419..8499655bfa 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -99,7 +99,11 @@ public:
#if LL_FASTTIMER_USE_RDTSC
static U32 getCPUClockCount32()
{
+#if _M_ARM64
+ unsigned __int64 val = _ReadStatusReg(ARM64_PMCCNTR_EL0);
+#else
unsigned __int64 val = __rdtsc();
+#endif
val = val >> 8;
return static_cast<U32>(val);
}
@@ -107,7 +111,11 @@ public:
// return full timer value, *not* shifted by 8 bits
static U64 getCPUClockCount64()
{
+#if _M_ARM64
+ return static_cast<U64>( _ReadStatusReg(ARM64_PMCCNTR_EL0) );
+#else
return static_cast<U64>( __rdtsc() );
+#endif
}
#else