JD2022-TU1/main/extern/Profiler/ExtProfiler/Profiler_Orbis.h

31 lines
583 B
C++

#ifndef ITF_EXTERN_PROFILER_ORBIS_H
#define ITF_EXTERN_PROFILER_ORBIS_H
#include <perf.h>
namespace Ext
{
class RAZORScopedProfiler
{
public:
RAZORScopedProfiler( const char* text, ... )
{
m_errorCode = sceRazorCpuPushMarker(text, SCE_RAZOR_COLOR_RED, SCE_RAZOR_MARKER_ENABLE_HUD);
}
~RAZORScopedProfiler()
{
if (m_errorCode == 0)
{
sceRazorCpuPopMarker();
}
}
private:
int m_errorCode;
};
}
#define PROFILER_SCOPED_EVENT(__name) Ext::RAZORScopedProfiler evt##__LINE__(__name)
#endif // ITF_EXTERN_PROFILER_ORBIS_H