#include <SimpleProfiler.h>
Public Member Functions | |
TSimpleProfiler (const char *name) | |
Constructor. | |
~TSimpleProfiler (void) | |
Destroy object. | |
void | Call (void) |
Increments number of calling by one. | |
void | TimeStart (void) |
Start profiling - save actual time. | |
void | TimeEnd (void) |
End profiling - compute difference between times. | |
void | PrintStat (void) |
Print statistic for this object. | |
const char * | GetName (void) const |
Returns name registered for this profiler. | |
long long | GetCalls (void) const |
Return total number of calls for this profiler. | |
long long | GetTotalTime (void) const |
Return total time measuerd by this profiler. | |
Static Public Member Functions | |
static void | AddObject (TSimpleProfiler *obj) |
Add object to list of objects. | |
static void | PrintAllStats (void) |
Prints statistic about all objects. | |
static void | PrintAllToFile (const char *file) |
Print statistics into file in TABLE format - items are separated by semicolon. | |
static void | RemoveAllProfilers (void) |
This method remove all profilers registered in list of profilers. | |
Static Public Attributes | |
static TListItem * | m_array = NULL |
linked list of this items | |
static TListItem * | m_arrayLast = NULL |
last item in linked list | |
Classes | |
struct | TListItem |
You should use it only via macros created above!!!
Each profiling object should be created as STATIC in place where profiling will be performed. In constructor this static object write himself to list of objects type TSimpleProfiler. With this you can get all information about application at end of program.
Because each profiler allocate static object on its place INLINE function cannot be inline! This may decrease performance but after disabling profilers INLINE will be used as INLINE.
Definition at line 92 of file SimpleProfiler.h.
|
Constructor. Creates object and add it to listo of objects of this type. Definition at line 31 of file SimpleProfiler.cpp. References AddObject(). Here is the call graph for this function: ![]() |
|
Destroy object. Don't remove object from list of objects!!! Definition at line 46 of file SimpleProfiler.cpp. |
|
Add object to list of objects.
Definition at line 89 of file SimpleProfiler.cpp. References m_array, and m_arrayLast. Referenced by TSimpleProfiler(). |
|
Increments number of calling by one.
Definition at line 141 of file SimpleProfiler.h. |
|
Return total number of calls for this profiler.
Definition at line 155 of file SimpleProfiler.h. |
|
Returns name registered for this profiler.
Definition at line 148 of file SimpleProfiler.h. |
|
Return total time measuerd by this profiler.
Definition at line 162 of file SimpleProfiler.h. |
|
Prints statistic about all objects.
Definition at line 111 of file SimpleProfiler.cpp. References m_array. |
|
Print statistics into file in TABLE format - items are separated by semicolon.
Definition at line 126 of file SimpleProfiler.cpp. References m_array. |
|
Print statistic for this object.
Definition at line 52 of file SimpleProfiler.cpp. |
|
This method remove all profilers registered in list of profilers. Profilers aren't removed physically - they are static objects. Only linked list of items is released and set to NULL.
Definition at line 158 of file SimpleProfiler.cpp. References m_array. |
|
End profiling - compute difference between times. Must be called after TimeStart!!!. Also increase number of calls. Definition at line 73 of file SimpleProfiler.cpp. |
|
Start profiling - save actual time.
Definition at line 59 of file SimpleProfiler.cpp. |
|
linked list of this items
Definition at line 129 of file SimpleProfiler.h. Referenced by AddObject(), PrintAllStats(), PrintAllToFile(), and RemoveAllProfilers(). |
|
last item in linked list
Definition at line 130 of file SimpleProfiler.h. Referenced by AddObject(). |