mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 14:03:52 +00:00
Scoped zone wrapper.
This commit is contained in:
parent
12a6306c0b
commit
09f9937133
31
client/TracyScoped.hpp
Executable file
31
client/TracyScoped.hpp
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef __TRACYSCOPED_HPP__
|
||||||
|
#define __TRACYSCOPED_HPP__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#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
|
Loading…
x
Reference in New Issue
Block a user