mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-13 03:41:48 +00:00
Full 64-bit register is set by rdtsc.
This commit is contained in:
parent
699ff43f1e
commit
cf88265304
@ -110,10 +110,14 @@ public:
|
|||||||
# endif
|
# endif
|
||||||
# elif defined _WIN32 || defined __CYGWIN__
|
# elif defined _WIN32 || defined __CYGWIN__
|
||||||
return int64_t( __rdtsc() );
|
return int64_t( __rdtsc() );
|
||||||
# elif defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64
|
# elif defined __i386 || defined _M_IX86
|
||||||
uint32_t eax, edx;
|
uint32_t eax, edx;
|
||||||
asm volatile ( "rdtsc" : "=a" (eax), "=d" (edx) );
|
asm volatile ( "rdtsc" : "=a" (eax), "=d" (edx) );
|
||||||
return ( uint64_t( edx ) << 32 ) + uint64_t( eax );
|
return ( uint64_t( edx ) << 32 ) + uint64_t( eax );
|
||||||
|
# elif defined __x86_64__ || defined _M_X64
|
||||||
|
uint64_t rax, rdx;
|
||||||
|
asm volatile ( "rdtsc" : "=a" (rax), "=d" (rdx) );
|
||||||
|
return ( rdx << 32 ) + rax;
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
|
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
|
||||||
|
Loading…
Reference in New Issue
Block a user