mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Allow checking timer implementation.
This commit is contained in:
parent
e39b1abce5
commit
602c38c6c0
@ -2141,16 +2141,23 @@ void Profiler::HandleDisconnect()
|
||||
}
|
||||
}
|
||||
|
||||
bool Profiler::IsTimerMonotonicRaw()
|
||||
{
|
||||
#if defined TRACY_HW_TIMER && !defined TARGET_OS_IOS && __ARM_ARCH >= 6
|
||||
return GetTimeImpl == GetTimeImplFallback;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Profiler::CalibrateTimer()
|
||||
{
|
||||
#ifdef TRACY_HW_TIMER
|
||||
# if __ARM_ARCH >= 6 && !defined TARGET_OS_IOS
|
||||
if( GetTimeImpl == GetTimeImplFallback )
|
||||
if( IsTimerMonotonicRaw() )
|
||||
{
|
||||
m_timerMul = 1.;
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
||||
std::atomic_signal_fence( std::memory_order_acq_rel );
|
||||
const auto t0 = std::chrono::high_resolution_clock::now();
|
||||
|
@ -440,6 +440,8 @@ public:
|
||||
void RequestShutdown() { m_shutdown.store( true, std::memory_order_relaxed ); m_shutdownManual.store( true, std::memory_order_relaxed ); }
|
||||
bool HasShutdownFinished() const { return m_shutdownFinished.load( std::memory_order_relaxed ); }
|
||||
|
||||
static bool IsTimerMonotonicRaw();
|
||||
|
||||
private:
|
||||
enum class DequeueStatus { Success, ConnectionLost, QueueEmpty };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user