1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add support for QPC timer.

This commit is contained in:
Bartosz Taudul
2020-04-07 22:01:31 +02:00
parent 34b512d04b
commit b69aaf04e9
3 changed files with 24 additions and 1 deletions
+8
View File
@@ -131,7 +131,11 @@ public:
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
# endif
# elif defined _WIN32 || defined __CYGWIN__
# ifdef TRACY_TIMER_QPC
return GetTimeQpc();
# else
return int64_t( __rdtsc() );
# endif
# elif defined __i386 || defined _M_IX86
uint32_t eax, edx;
asm volatile ( "rdtsc" : "=a" (eax), "=d" (edx) );
@@ -609,6 +613,10 @@ private:
GetProfiler().m_serialQueue.commit_next();
}
#if ( defined _WIN32 || defined __CYGWIN__ ) && defined TRACY_TIMER_QPC
static int64_t GetTimeQpc();
#endif
double m_timerMul;
uint64_t m_resolution;
uint64_t m_delay;