[development] Migrate Atom CPU timing stats tracking to use global stats profiler (#4549)
This change is a preparation for moving the CPU profiler/visualization system from Atom into its own Gem by removing the dependency on local time tracking object AZ::RHI::CpuTimingStatistics Full changes include: - Removed all usage of AZ::RHI::CpuTimingStatistics -- Replaced with pushing to AZ::Statistics::StatisticalProfilerProxy global instance - Promoted VariableTimer from AZ::RHI to AZ::Debug - Removed now unused CpuTimingStatistics.h Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
This commit is contained in:
@@ -46,5 +46,23 @@ namespace AZ
|
||||
private:
|
||||
AZStd::sys_time_t m_timeStamp;
|
||||
};
|
||||
|
||||
//! Utility type that updates the given variable with the lifetime of the object in cycles.
|
||||
//! Useful for quick scope based timing.
|
||||
struct ScopedTimer
|
||||
{
|
||||
explicit ScopedTimer(AZStd::sys_time_t& variable)
|
||||
: m_variable(variable)
|
||||
{
|
||||
m_timer.Stamp();
|
||||
}
|
||||
~ScopedTimer()
|
||||
{
|
||||
m_variable = m_timer.GetDeltaTimeInTicks();
|
||||
}
|
||||
|
||||
AZStd::sys_time_t& m_variable;
|
||||
Timer m_timer;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user