27#ifndef __AUDACITY_PROFILER__
28#define __AUDACITY_PROFILER__
35#define BEGIN_TASK_PROFILING(TASK_DESCRIPTION) Profiler::Instance()->Begin(__FILE__,__LINE__,TASK_DESCRIPTION)
36#define END_TASK_PROFILING(TASK_DESCRIPTION) Profiler::Instance()->End(__FILE__,__LINE__,TASK_DESCRIPTION)
47 void Begin(
const char* fileName,
int lineNum,
const char* taskDescription);
49 void End(
const char* fileName,
int lineNum,
const char* taskDescription);
63 std::vector<std::unique_ptr<TaskProfile>>
mTasks;
76 void Begin(
const char* fileName,
int lineNum,
const char* taskDescription);
78 void End(
const char* fileName,
int lineNum,
const char* taskDescription);
A simple profiler to measure the average time lengths that a particular task/function takes....
virtual ~Profiler()
write to a profile at the end of the test.
TaskProfile * GetOrCreateTaskProfile(const char *fileName, int lineNum)
find a taskProfile for the given task, otherwise create
void Begin(const char *fileName, int lineNum, const char *taskDescription)
start the task timer.
Profiler()
private constructor - Singleton.
void End(const char *fileName, int lineNum, const char *taskDescription)
end the task timer.
std::vector< std::unique_ptr< TaskProfile > > mTasks
TaskProfile * GetTaskProfileByDescription(const char *description)
static Profiler * Instance()
Gets the singleton instance.
a simple class to keep track of one task that may be called multiple times.
void End(const char *fileName, int lineNum, const char *taskDescription)
end the task timer.
void Begin(const char *fileName, int lineNum, const char *taskDescription)
start the task timer.
double ComputeAverageRunTime()
ArrayOf< char > mDescription
TaskProfile()
Task Profile.
ArrayOf< char > mFileName