Audacity 3.2.0
|
A simple profiler to measure the average time lengths that a particular task/function takes. Currently not thread-safe and not thread-smart, but it will probably work fine if you use it on a high level. More...
#include <Profiler.h>
Public Member Functions | |
virtual | ~Profiler () |
write to a profile at the end of the test. More... | |
void | Begin (const char *fileName, int lineNum, const char *taskDescription) |
start the task timer. More... | |
void | End (const char *fileName, int lineNum, const char *taskDescription) |
end the task timer. More... | |
Static Public Member Functions | |
static Profiler * | Instance () |
Gets the singleton instance. More... | |
Protected Member Functions | |
Profiler () | |
private constructor - Singleton. More... | |
TaskProfile * | GetOrCreateTaskProfile (const char *fileName, int lineNum) |
find a taskProfile for the given task, otherwise create More... | |
TaskProfile * | GetTaskProfileByDescription (const char *description) |
Protected Attributes | |
std::vector< std::unique_ptr< TaskProfile > > | mTasks |
std::mutex | mTasksMutex |
A simple profiler to measure the average time lengths that a particular task/function takes. Currently not thread-safe and not thread-smart, but it will probably work fine if you use it on a high level.
Definition at line 39 of file Profiler.h.
|
virtual |
write to a profile at the end of the test.
Definition at line 30 of file Profiler.cpp.
References mTasks.
|
inlineprotected |
void Profiler::Begin | ( | const char * | fileName, |
int | lineNum, | ||
const char * | taskDescription | ||
) |
start the task timer.
Definition at line 63 of file Profiler.cpp.
References TaskProfile::Begin(), GetOrCreateTaskProfile(), and mTasksMutex.
void Profiler::End | ( | const char * | fileName, |
int | lineNum, | ||
const char * | taskDescription | ||
) |
end the task timer.
Definition at line 70 of file Profiler.cpp.
References TaskProfile::End(), GetTaskProfileByDescription(), and mTasksMutex.
|
protected |
find a taskProfile for the given task, otherwise create
Definition at line 89 of file Profiler.cpp.
References mTasks.
Referenced by Begin().
|
protected |
Definition at line 102 of file Profiler.cpp.
References mTasks.
Referenced by End().
|
static |
Gets the singleton instance.
Definition at line 80 of file Profiler.cpp.
|
protected |
Definition at line 63 of file Profiler.h.
Referenced by GetOrCreateTaskProfile(), GetTaskProfileByDescription(), and ~Profiler().
|
protected |
Definition at line 65 of file Profiler.h.