tracy/client/TracyScoped.hpp
Bartosz Taudul 206305fbd2 Merge TracyThread.hpp to TracySystem.cpp.
Keeping threading functions inside a source file prevents poisoning by
including windows.h.
2017-09-25 21:13:59 +02:00

32 lines
563 B
C++
Executable File

#ifndef __TRACYSCOPED_HPP__
#define __TRACYSCOPED_HPP__
#include <stdint.h>
#include "../common/TracySystem.hpp"
#include "TracyProfiler.hpp"
namespace tracy
{
class ScopedZone
{
public:
ScopedZone( const char* file, const char* function, uint32_t line )
: m_id( Profiler::ZoneBegin( QueueZoneBegin { Profiler::GetTime(), (uint64_t)file, (uint64_t)function, line, GetThreadHandle() } ) )
{
}
~ScopedZone()
{
Profiler::ZoneEnd( m_id, QueueZoneEnd { Profiler::GetTime() } );
}
private:
uint64_t m_id;
};
}
#endif