mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 04:01:48 +00:00
32 lines
481 B
C++
32 lines
481 B
C++
|
#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
|