[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:
Scott Romero
2021-10-11 14:00:42 -07:00
committed by GitHub
parent d3c2e288e9
commit a95c609bd8
36 changed files with 213 additions and 221 deletions
@@ -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;
};
}
}