mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 09:14:36 +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()
|
void Profiler::CalibrateTimer()
|
||||||
{
|
{
|
||||||
#ifdef TRACY_HW_TIMER
|
#ifdef TRACY_HW_TIMER
|
||||||
# if __ARM_ARCH >= 6 && !defined TARGET_OS_IOS
|
if( IsTimerMonotonicRaw() )
|
||||||
if( GetTimeImpl == GetTimeImplFallback )
|
|
||||||
{
|
{
|
||||||
m_timerMul = 1.;
|
m_timerMul = 1.;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
std::atomic_signal_fence( std::memory_order_acq_rel );
|
std::atomic_signal_fence( std::memory_order_acq_rel );
|
||||||
const auto t0 = std::chrono::high_resolution_clock::now();
|
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 ); }
|
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 ); }
|
bool HasShutdownFinished() const { return m_shutdownFinished.load( std::memory_order_relaxed ); }
|
||||||
|
|
||||||
|
static bool IsTimerMonotonicRaw();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class DequeueStatus { Success, ConnectionLost, QueueEmpty };
|
enum class DequeueStatus { Success, ConnectionLost, QueueEmpty };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user