Add QPC frequency query to API.

This commit is contained in:
Bartosz Taudul 2020-07-07 21:24:44 +02:00
parent 1013ec8db7
commit 5e5bf928a5
2 changed files with 12 additions and 0 deletions

View File

@ -873,6 +873,17 @@ static Thread* s_sysTraceThread = nullptr;
TRACY_API bool ProfilerAvailable() { return s_instance != nullptr; } TRACY_API bool ProfilerAvailable() { return s_instance != nullptr; }
TRACY_API int64_t GetFrequencyQpc()
{
#if defined _WIN32 || defined __CYGWIN__
LARGE_INTEGER t;
QueryPerformanceFrequency( &t );
return t.QuadPart;
#else
return 0;
#endif
}
#ifdef TRACY_DELAYED_INIT #ifdef TRACY_DELAYED_INIT
struct ThreadNameData; struct ThreadNameData;
TRACY_API moodycamel::ConcurrentQueue<QueueItem>& GetQueue(); TRACY_API moodycamel::ConcurrentQueue<QueueItem>& GetQueue();

View File

@ -60,6 +60,7 @@ TRACY_API GpuCtxWrapper& GetGpuCtx();
TRACY_API uint64_t GetThreadHandle(); TRACY_API uint64_t GetThreadHandle();
TRACY_API void InitRPMallocThread(); TRACY_API void InitRPMallocThread();
TRACY_API bool ProfilerAvailable(); TRACY_API bool ProfilerAvailable();
TRACY_API int64_t GetFrequencyQpc();
struct SourceLocationData struct SourceLocationData
{ {