5 #ifndef __I_PROFILER_H_INCLUDED__ 6 #define __I_PROFILER_H_INCLUDED__ 284 if ( idx >= 0 &&
Timer )
306 u32 diffTime = timeNow -
data.LastTimeStarted;
307 data.TimeSum += diffTime;
308 if ( diffTime >
data.LongestTime )
309 data.LongestTime = diffTime;
310 data.LastTimeStarted = 0;
315 group.TimeSum += diffTime;
316 if ( diffTime >
group.LongestTime )
317 group.LongestTime = diffTime;
318 group.LastTimeStarted = 0;
359 data.GroupIndex = groupIdx;
472 #ifdef _IRR_COMPILE_WITH_PROFILING_ 473 #define IRR_PROFILE(X) X 475 #define IRR_PROFILE(X) 476 #endif // IRR_PROFILE 480 #endif // __I_PROFILER_H_INCLUDED__ bool operator<(const SProfileData &pd) const
virtual void printGroup(core::stringw &result, u32 groupIndex, bool suppressUncalled) const =0
Write the profile data of one group into a string.
u32 getTimeSum() const
Time spend between start/stop.
Used to store the profile data (and also used for profile group data).
Class where the objects profile their own life-time.
const core::stringw & getName() const
core::array< SProfileData > ProfileGroups
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define IRRLICHT_API
Set FPU settings.
u32 getCallsCounter() const
Each time profiling for this data is stopped it increases the counter by 1.
GLuint const GLchar * name
IProfiler()
Constructor. You could use this to create a new profiler, but usually getProfiler() is used to access...
Everything in the Irrlicht Engine can be found in this namespace.
u32 getProfileDataCount() const
Return the number of profile data blocks. There is one for each id.
Very simple string class with some useful features.
IRRLICHT_API IProfiler &IRRCALLCONV getProfiler()
Access the Irrlicht profiler object.
virtual void printAll(core::stringw &result, bool includeOverview=false, bool suppressUncalled=true) const =0
Write all profile-data into a string.
void resetDataById(s32 id)
Reset profile data for the given id.
signed int s32
32 bit signed variable.
CProfileScope(s32 id)
Construct with an known id.
CProfileScope(const core::stringw &name, const core::stringw &groupName)
Object will create an id for the given name, groupName combination if they don't exist already.
unsigned int u32
32 bit unsigned variable.
void add(s32 id, const core::stringw &name, const core::stringw &groupName)
Add an id with given name and group which can be used for profiling with start/stop.
Interface for getting and manipulating the virtual time.
u32 getGroupCount() const
Get the number of profile groups. Will be at least 1.
const SProfileData & getProfileDataByIndex(u32 index) const
Get the profile data.
bool operator==(const SProfileData &pd) const
virtual u32 getRealTime() const =0
Returns current real time in milliseconds of the system.
const SProfileData & getGroupData(u32 index) const
Get profile data for a group.
void start(s32 id)
Start profile-timing for the given id.
void resetDataByIndex(u32 index)
Reset profile data for the given index.
u32 getLongestTime() const
Longest time a profile call for this id took from start until it was stopped again.
Self reallocating template array (like stl vector) with additional features.
const SProfileData * getProfileDataById(u32 id)
Get the profile data.
Code-profiler. Please check the example in the Irrlicht examples folder about how to use it.
void resetGroup(u32 index)
Reset profile data for a whole group.
void stop(s32 id)
Stop profile-timing for the given id.
bool findGroupIndex(u32 &result, const core::stringw &name) const
Find the group index by the group-name.
u32 getGroupIndex() const
void resetAll()
Reset all profile data.
core::array< SProfileData > ProfileDatas
bool findDataIndex(u32 &result, const core::stringw &name) const
Search for the index of the profile data by name.
CProfileScope(s32 id, const core::stringw &name, const core::stringw &groupName)
Object will create the given name, groupName combination for the id if it doesn't exist already.
u32 addGroup(const core::stringw &name)
string< wchar_t > stringw
Typedef for wide character strings.