From 09f99371337dfa31ad44afee56bc927366f4ad66 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 10 Sep 2017 20:09:57 +0200 Subject: [PATCH] Scoped zone wrapper. --- client/TracyScoped.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 client/TracyScoped.hpp diff --git a/client/TracyScoped.hpp b/client/TracyScoped.hpp new file mode 100755 index 00000000..6e501bb4 --- /dev/null +++ b/client/TracyScoped.hpp @@ -0,0 +1,31 @@ +#ifndef __TRACYSCOPED_HPP__ +#define __TRACYSCOPED_HPP__ + +#include + +#include "TracyProfiler.hpp" + +namespace tracy +{ + +class ScopedZone +{ +public: + ScopedZone( const char* file, const char* function, uint32_t line ) + : m_id( Profiler::GetNewId() ) + { + Profiler::ZoneBegin( QueueZoneBegin { m_id, file, function, line } ); + } + + ~ScopedZone() + { + Profiler::ZoneEnd( QueueZoneEnd { m_id } ); + } + +private: + uint64_t m_id; +}; + +} + +#endif