diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4af6f290..19bdb268 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -8707,4 +8707,18 @@ void View::SetViewToLastFrames() } } +int64_t View::GetZoneChildTime( const ZoneEvent& zone ) +{ + int64_t time = 0; + if( zone.child >= 0 ) + { + for( auto& v : m_worker.GetZoneChildren( zone.child ) ) + { + const auto childSpan = std::max( int64_t( 0 ), v->end - v->start ); + time += childSpan; + } + } + return time; +} + } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 2901df14..abee0eb7 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -161,6 +161,7 @@ private: void SmallCallstackButton( const char* name, uint32_t callstack, int& idx ); void SetViewToLastFrames(); + int64_t GetZoneChildTime( const ZoneEvent& zone ); flat_hash_map> m_visible; flat_hash_map> m_visibleMsgThread;