33 using Bucket = std::pair<agx::Name, agx::Real>;
59 Profiler::registerTiming(m_name, m_timer.getTime());
67#define SCOPE_PROFILER(a) agxTerrain::ScopeTimerRef ref = new agxTerrain::ScopeTimer(a);
68#define PRINT_TIMINGS() Profiler::printTimers();
96#define USE_EXTENDED_TERRAIN_PROFILING 1
97#if defined(USE_EXTENDED_TERRAIN_PROFILING) && USE_EXTENDED_TERRAIN_PROFILING
98 #define GET_TIMESTAMP(varname) agx::UInt64 varname = agx::Timer::getCurrentTick();
99 #define THREAD_LOG_ITEM( textname, var1, var2 ) agx::Thread::getCurrentThread()->reportSystemJob( var1, var2, textname );
100 #define GET_SCOPE_SYSTEM_JOB(scopeName, varname) agxTerrain::ScopeReportSystemJobRef varname = new agxTerrain::ScopeReportSystemJob(scopeName);
101 #define TIMER_BLOCK( str )\
102 auto sjrtb = agxUtil::TimerBlock([]( agx::UInt64 start, agx::UInt64 stop )\
104 std::cout << std::left << std::setw( 50 ) << std::setfill( ' ' )\
106 << " : " << agx::Timer::convertToMs( stop - start ) << " ms." << std::endl;\
109 #define GET_TIMESTAMP( varname )
110 #define THREAD_LOG_ITEM( textname, var1, var2 )
111 #define GET_SCOPE_SYSTEM_JOB( scopeName, varname )
112 #define TIMER_BLOCK( str )
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXTERRAIN_EXPORT
ScopeReportSystemJob(const char *name)
virtual ~ScopeReportSystemJob()
ScopeTimer(const agx::Name &name)
agx::HighAccuracyTimer m_timer
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
The HighAccurayTimer class can replace the regular Timer class in high level applications where the n...
Representation of a name string.
Base class providing referencing counted objects.
static Thread * getCurrentThread()
void reportSystemJob(UInt64 startTick, UInt64 endTick, const char *description, const char *extraDataTitle=nullptr, agx::Real64 extraData=0.0)
Add an entry to the job duration log.
static UInt64 getCurrentTick()
AGXTERRAIN_EXPORT agx::Real & currentTime()
AGXTERRAIN_EXPORT TimingStorage & getStorage()
AGXTERRAIN_EXPORT void resetFile(const agx::String &filename)
AGXTERRAIN_EXPORT void registerTiming(const agx::Name &name, agx::Real value)
AGXTERRAIN_EXPORT void printTimers(const agx::String &title)
agx::HashVector< agx::Name, agx::Real > TimingStorage
std::pair< agx::Name, agx::Real > Bucket
AGXTERRAIN_EXPORT void clear()
AGXTERRAIN_EXPORT void printToFile(agx::Real time, const agx::String &filename)
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.