2017-09-10 18:09:57 +00:00
|
|
|
#ifndef __TRACYSCOPED_HPP__
|
|
|
|
#define __TRACYSCOPED_HPP__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "TracyProfiler.hpp"
|
2017-09-21 23:11:53 +00:00
|
|
|
#include "TracyThread.hpp"
|
2017-09-10 18:09:57 +00:00
|
|
|
|
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class ScopedZone
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScopedZone( const char* file, const char* function, uint32_t line )
|
2017-09-21 23:11:53 +00:00
|
|
|
: m_id( Profiler::ZoneBegin( QueueZoneBegin { GetTime(), (uint64_t)file, (uint64_t)function, line, GetThreadHandle() } ) )
|
2017-09-10 18:09:57 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~ScopedZone()
|
|
|
|
{
|
2017-09-13 23:07:14 +00:00
|
|
|
Profiler::ZoneEnd( m_id, QueueZoneEnd { GetTime() } );
|
2017-09-10 18:09:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint64_t m_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|