mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
31 lines
487 B
C++
Executable File
31 lines
487 B
C++
Executable File
#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::ZoneBegin( QueueZoneBegin { GetTime(), (uint64_t)file, (uint64_t)function, line } ) )
|
|
{
|
|
}
|
|
|
|
~ScopedZone()
|
|
{
|
|
Profiler::ZoneEnd( m_id, QueueZoneEnd { GetTime() } );
|
|
}
|
|
|
|
private:
|
|
uint64_t m_id;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|