This engine provides the following functionality
Definition in file AProfiler.cpp.
#include "AEngine.h"
#include "AState.h"
#include "AConstants.h"
#include "ADevice.h"
#include "ASharedFunc.h"
Include dependency graph for AProfiler.cpp:

Go to the source code of this file.
Functions | |
| __int64 | getOSTime () |
| void | profiler_begin (string s) |
| void | profiler_end (string s) |
| void | profiler_reset () |
| void | profiler_render () |
|
|
Definition at line 38 of file AProfiler.cpp. References time. Referenced by profiler_begin(), profiler_end(), profiler_render(), and profiler_reset().
|
|
|
Definition at line 56 of file AProfiler.cpp. References getOSTime(). Referenced by AProfilerBlock::AProfilerBlock(), and doGameLoop().
00057 {
00058 map<string,__int64>::iterator iter;
00059 iter = AS.profiler_startTime.find(s);
00060 if( iter==AS.profiler_startTime.end() ) // if this is the first time we come across this name
00061 {
00062 AS.profiler_startTime[s] = getOSTime();
00063 AS.profiler_totalTime[s] = 0;
00064 AS.profiler_names.push_back(s);
00065 }
00066 else
00067 {
00068 AS.profiler_startTime[s] = getOSTime();
00069 }
00070 }
|
|
|
Definition at line 72 of file AProfiler.cpp. References getOSTime(). Referenced by doGameLoop(), and AProfilerBlock::~AProfilerBlock().
00073 {
00074 map<string,__int64>::iterator iter;
00075 iter = AS.profiler_totalTime.find(s);
00076 if( iter==AS.profiler_totalTime.end() )
00077 {
00078 throw Error("Profiler_end("+s+") not preceded by Profiler_begin");
00079 }
00080 else
00081 {
00082 iter->second += getOSTime() - AS.profiler_startTime.find(s)->second;
00083 }
00084 }
|
|
|
Definition at line 94 of file AProfiler.cpp. References getOSTime(), sys_console(), and UINT. Referenced by doGameLoop().
00095 {
00096 sys_console() << "-------BEGIN-PROFILER-SUMMARY-------" << endl;
00097 __int64 t = getOSTime();
00098 __int64 deltaT = t - AS.profiler_RDTSClastReset;
00099 for( UINT i=0; i<AS.profiler_names.size(); i++ )
00100 {
00101 string s = AS.profiler_names[i];
00102 FLOAT percent = AS.profiler_totalTime.find(s)->second * 100.0f / deltaT;
00103 while( s.length()<24 ) s += " ";
00104 sys_console() << s << percent << endl;
00105 }
00106 }
|
|
|
Definition at line 86 of file AProfiler.cpp. References getOSTime(), sys_getMilliSec(), and UINT. Referenced by doGameLoop().
00087 {
00088 for( UINT i=0; i<AS.profiler_names.size(); i++ )
00089 AS.profiler_totalTime.find( AS.profiler_names[i] )->second = 0;
00090 AS.profiler_RDTSClastReset = getOSTime();
00091 AS.profiler_MSlastReset = sys_getMilliSec();
00092 }
|
1.3-rc2