Pol  Revision:cb584c9
profile.h File Reference
#include "../clib/rawtypes.h"
#include <atomic>
#include <cstddef>
#include <ctime>

Go to the source code of this file.

Classes

struct  Pol::Core::ProfileVars
 

Namespaces

 Pol
 
 Pol::Core
 

Macros

#define CLOCK_PROFILEVAR(timer)   clock_t tmr_##timer##_clocks_this_min, tmr_##timer##_clocks_last_min, tmr_##timer##_clock_start
 
#define DEF_PROFILEVAR(counter)   unsigned int prf_##counter, prf_last_##counter, prf_last_##counter##_per_min
 
#define GET_PROFILECLOCK(timer)   Core::stateManager.profilevars.tmr_##timer##_clocks_last_min
 
#define GET_PROFILECLOCK_MS(timer)
 
#define GET_PROFILEVAR(counter)   Core::stateManager.profilevars.prf_##counter
 
#define GET_PROFILEVAR_PER_MIN(counter)   Core::stateManager.profilevars.prf_last_##counter##_per_min
 
#define INC_PROFILEVAR(counter)   ++Core::stateManager.profilevars.prf_##counter
 
#define INC_PROFILEVAR_BY(counter, amount)   Core::stateManager.profilevars.prf_##counter += amount
 
#define ROLL_PROFILECLOCK(timer)
 
#define SET_PROFILEVAR(counter, newvalue)   Core::stateManager.profilevars.prf_##counter = newvalue
 
#define START_PROFILECLOCK(timer)   Core::stateManager.profilevars.tmr_##timer##_clock_start = clock()
 
#define STOP_PROFILECLOCK(timer)
 
#define TICK_PROFILEVAR(counter)
 

Detailed Description

History
  • 2006/09/23 Shinigami: Script_Cycles, Sleep_Cycles and Script_passes uses 64bit now

Definition in file profile.h.

Macro Definition Documentation

#define CLOCK_PROFILEVAR (   timer)    clock_t tmr_##timer##_clocks_this_min, tmr_##timer##_clocks_last_min, tmr_##timer##_clock_start

Definition at line 23 of file profile.h.

#define DEF_PROFILEVAR (   counter)    unsigned int prf_##counter, prf_last_##counter, prf_last_##counter##_per_min

Definition at line 20 of file profile.h.

#define GET_PROFILECLOCK (   timer)    Core::stateManager.profilevars.tmr_##timer##_clocks_last_min

Definition at line 115 of file profile.h.

#define GET_PROFILECLOCK_MS (   timer)
Value:
( static_cast<unsigned int>( Core::stateManager.profilevars.tmr_##timer##_clocks_last_min * \
1000.0 / Core::CLOCKS_PER_SEC ) )
ProfileVars profilevars
Definition: state.h:47
StateManager stateManager
Definition: state.cpp:8

Definition at line 116 of file profile.h.

#define GET_PROFILEVAR (   counter)    Core::stateManager.profilevars.prf_##counter

Definition at line 99 of file profile.h.

Referenced by Pol::Core::log_all_script_cycle_counts().

#define GET_PROFILEVAR_PER_MIN (   counter)    Core::stateManager.profilevars.prf_last_##counter##_per_min

Definition at line 100 of file profile.h.

Referenced by Pol::Module::GetCoreVariable(), and Pol::Core::update_rpm().

#define INC_PROFILEVAR_BY (   counter,
  amount 
)    Core::stateManager.profilevars.prf_##counter += amount

Definition at line 87 of file profile.h.

Referenced by Pol::Core::check_scheduled_tasks().

#define ROLL_PROFILECLOCK (   timer)
Value:
do \
{ \
Core::stateManager.profilevars.tmr_##timer##_clocks_last_min = \
Core::stateManager.profilevars.tmr_##timer##_clocks_this_min; \
Core::stateManager.profilevars.tmr_##timer##_clocks_this_min = 0; \
} while ( 0 )
ProfileVars profilevars
Definition: state.h:47
StateManager stateManager
Definition: state.cpp:8

Definition at line 108 of file profile.h.

Referenced by Pol::Core::update_rpm().

#define SET_PROFILEVAR (   counter,
  newvalue 
)    Core::stateManager.profilevars.prf_##counter = newvalue

Definition at line 86 of file profile.h.

Referenced by Pol::Core::update_rpm().

#define START_PROFILECLOCK (   timer)    Core::stateManager.profilevars.tmr_##timer##_clock_start = clock()

Definition at line 103 of file profile.h.

Referenced by Pol::Module::UOExecutorModule::mf_CreateNpcFromTemplate().

#define STOP_PROFILECLOCK (   timer)
Value:
Core::stateManager.profilevars.tmr_##timer##_clocks_this_min += \
clock() - Core::stateManager.profilevars.tmr_##timer##_clock_start
ProfileVars profilevars
Definition: state.h:47
StateManager stateManager
Definition: state.cpp:8

Definition at line 105 of file profile.h.

Referenced by Pol::Module::UOExecutorModule::mf_CreateNpcFromTemplate().

#define TICK_PROFILEVAR (   counter)
Value:
do \
{ \
Core::stateManager.profilevars.prf_last_##counter##_per_min = \
Core::stateManager.profilevars.prf_last_##counter; \
Core::stateManager.profilevars.prf_last_##counter = \
} while ( 0 )
ProfileVars profilevars
Definition: state.h:47
StateManager stateManager
Definition: state.cpp:8

Definition at line 89 of file profile.h.

Referenced by Pol::Core::update_rpm().