diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index f56e5596f5496fd862ff3b39bf9ad21123ca5494..0336f9d0e9d39baf77dc8c0979ae4c705427ceb4 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -91,6 +91,7 @@ class BlockTimer static U32 getCPUClockCount32() { U32 ret_val; +#if !defined(_M_AMD64) __asm { _emit 0x0f @@ -100,6 +101,11 @@ class BlockTimer or eax, edx mov dword ptr [ret_val], eax } +#else + unsigned __int64 val = __rdtsc(); + val = val >> 8; + ret_val = static_cast<U32>(val); +#endif return ret_val; } @@ -107,6 +113,7 @@ class BlockTimer static U64 getCPUClockCount64() { U64 ret_val; +#if !defined(_M_AMD64) __asm { _emit 0x0f @@ -116,6 +123,9 @@ class BlockTimer mov dword ptr [ret_val+4], edx mov dword ptr [ret_val], eax } +#else + ret_val = static_cast<U64>( __rdtsc() ); +#endif return ret_val; }