#include <hierarchical_timer.h>
Nevrax France
Definition at line 96 of file hierarchical_timer.h.
Public Member Functions | |
CSimpleClock () | |
uint64 | getNumTicks () const |
void | start () |
void | stop () |
Static Public Member Functions | |
uint64 | getStartStopNumTicks () |
void | init () |
Private Attributes | |
uint64 | _NumTicks |
uint64 | _StartTick |
Static Private Attributes | |
bool | _InitDone = false |
uint64 | _StartStopNumTicks = 0 |
|
Definition at line 99 of file hierarchical_timer.h. References _NumTicks.
00099 : _NumTicks(0) 00100 { 00101 # ifdef NL_DEBUG 00102 _Started = false; 00103 # endif 00104 } |
|
Definition at line 133 of file hierarchical_timer.h. References _NumTicks, nlassert, and uint64. Referenced by NLMISC::CHTimer::display(), NLMISC::CHTimer::displayByExecutionPath(), NLMISC::CHTimer::displayHierarchical(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::doBefore(), init(), and NL3D::CMiniTimer::~CMiniTimer().
|
|
Get the number of ticks needed to perform start(). Should have called init() before calling this. Definition at line 146 of file hierarchical_timer.h. References _StartStopNumTicks, and uint64.
00147 { 00148 return _StartStopNumTicks; 00149 } |
|
Definition at line 67 of file hierarchical_timer.cpp. References _InitDone, _StartStopNumTicks, getNumTicks(), start(), stop(), and uint.
00068 { 00069 if (_InitDone) return; 00070 const uint numSamples = 10000; 00071 00072 CSimpleClock observedClock; 00073 CSimpleClock measuringClock; 00074 00075 measuringClock.start(); 00076 for(uint l = 0; l < numSamples; ++l) 00077 { 00078 observedClock.start(); 00079 observedClock.stop(); 00080 } 00081 measuringClock.stop(); 00082 00083 _StartStopNumTicks = (measuringClock.getNumTicks() >> 1) / numSamples; 00084 _InitDone = true; 00085 } |
|
Definition at line 106 of file hierarchical_timer.h. References _StartTick, and nlassert. Referenced by NL3D::CMiniTimer::CMiniTimer(), NLMISC::CHTimer::display(), NLMISC::CHTimer::displayByExecutionPath(), NLMISC::CHTimer::displayHierarchical(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::doBefore(), and init().
00107 { 00108 # ifdef NL_DEBUG 00109 nlassert(!_Started); 00110 _Started = true; 00111 # endif 00112 # ifdef NL_CPU_INTEL 00113 _StartTick = rdtsc(); 00114 # else 00115 _StartTick = CTime::getPerformanceTime(); 00116 # endif 00117 } |
|
Definition at line 119 of file hierarchical_timer.h. References _NumTicks, _StartTick, and nlassert. Referenced by NLMISC::CHTimer::display(), NLMISC::CHTimer::displayByExecutionPath(), NLMISC::CHTimer::displayHierarchical(), NLMISC::CHTimer::displayHierarchicalByExecutionPathSorted(), NLMISC::CHTimer::displaySummary(), NLMISC::CHTimer::doAfter(), NLMISC::CHTimer::doBefore(), init(), and NL3D::CMiniTimer::~CMiniTimer().
00120 { 00121 # ifdef NL_DEBUG 00122 nlassert(_Started); 00123 _Started = false; 00124 # endif 00125 # ifdef NL_CPU_INTEL 00126 _NumTicks = rdtsc() - _StartTick; 00127 # else 00128 _NumTicks = CTime::getPerformanceTime() - _StartTick; 00129 # endif 00130 00131 } |
|
Definition at line 43 of file hierarchical_timer.cpp. Referenced by init(). |
|
Definition at line 152 of file hierarchical_timer.h. Referenced by CSimpleClock(), getNumTicks(), and stop(). |
|
Definition at line 44 of file hierarchical_timer.cpp. Referenced by getStartStopNumTicks(), and init(). |
|
Definition at line 151 of file hierarchical_timer.h. |