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 35 of file profilezone.hxx.

Constructor & Destructor Documentation

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

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 62 of file profilezone.hxx.

comphelper::ProfileZone::~ProfileZone ( )

Definition at line 72 of file profilezone.hxx.

References comphelper::ProfileRecording::addRecording().

Member Function Documentation

void comphelper::ProfileZone::startConsole ( )

Definition at line 103 of file profilezone.cxx.

void comphelper::ProfileZone::stopConsole ( )

Definition at line 105 of file profilezone.cxx.

Member Data Documentation

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

Definition at line 45 of file profilezone.hxx.

long long comphelper::ProfileZone::m_aCreateTime

Definition at line 39 of file profilezone.hxx.

bool comphelper::ProfileZone::m_bConsole

Definition at line 40 of file profilezone.hxx.

const char* comphelper::ProfileZone::m_sProfileId

Definition at line 38 of file profilezone.hxx.

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