LibreOffice Module comphelper (master)  1
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
comphelper::ProfileZone Class Reference

#include <profilezone.hxx>

Public Member Functions

 ProfileZone (const char *sProfileId, bool bConsole=false)
 Starts measuring the cost of a C++ scope. More...
 
 ~ProfileZone ()
 

Static Public Attributes

static std::atomic< bool > g_bRecording
 

Private Member Functions

void startConsole ()
 
void stopConsole ()
 

Private Attributes

const char * m_sProfileId
 
long long m_aCreateTime
 
bool m_bConsole
 

Detailed Description

Definition at line 37 of file profilezone.hxx.

Constructor & Destructor Documentation

comphelper::ProfileZone::ProfileZone ( const char *  sProfileId,
bool  bConsole = false 
)
inline

Starts measuring the cost of a C++ scope.

Note that the char pointer is stored as such in the ProfileZone object and used in the destructor, so be sure to pass a pointer that stays valid for the duration of the object's lifetime.

The second parameter can be used for ad-hoc local measuring by adding a single line of code at a C++ scope start. Example:

comphelper::ProfileZone aZone("RtfFilter::filter", true);

Similar to the DEBUG macro in sal/log.hxx, don't forget to remove these lines before committing.

Definition at line 63 of file profilezone.hxx.

comphelper::ProfileZone::~ProfileZone ( )
inline

Definition at line 73 of file profilezone.hxx.

References comphelper::ProfileRecording::addRecording().

Member Function Documentation

void comphelper::ProfileZone::startConsole ( )
private

Definition at line 102 of file profilezone.cxx.

void comphelper::ProfileZone::stopConsole ( )
private

Definition at line 104 of file profilezone.cxx.

Member Data Documentation

std::atomic< bool > comphelper::ProfileZone::g_bRecording
static

Definition at line 46 of file profilezone.hxx.

long long comphelper::ProfileZone::m_aCreateTime
private

Definition at line 41 of file profilezone.hxx.

bool comphelper::ProfileZone::m_bConsole
private

Definition at line 42 of file profilezone.hxx.

const char* comphelper::ProfileZone::m_sProfileId
private

Definition at line 40 of file profilezone.hxx.


The documentation for this class was generated from the following files: