summaryrefslogtreecommitdiff
path: root/include/comphelper/profilezone.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/comphelper/profilezone.hxx')
-rw-r--r--include/comphelper/profilezone.hxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
index 36730e7f8af6..ec2a5a41d34a 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -23,24 +23,24 @@ namespace comphelper
class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
{
- static int s_nNesting; // level of nested zones.
-
long long m_nCreateTime;
int m_nNesting;
void addRecording();
+ static void setNestingLevel(int nNestingLevel);
+ static int getNestingLevel();
+
ProfileZone(const char* sName, const OUString &sArgs)
: NamedEvent(sName, sArgs)
, m_nNesting(-1)
{
if (s_bRecording)
{
- TimeValue systemTime;
- osl_getSystemTime( &systemTime );
- m_nCreateTime = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec/1000;
+ m_nCreateTime = getNow();
- m_nNesting = s_nNesting++;
+ m_nNesting = getNestingLevel();
+ setNestingLevel(getNestingLevel() + 1);
}
else
m_nCreateTime = 0;
@@ -65,9 +65,9 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
{
if (m_nCreateTime > 0)
{
- s_nNesting--;
+ setNestingLevel(getNestingLevel() - 1);
- if (m_nNesting != s_nNesting)
+ if (m_nNesting != getNestingLevel())
{
SAL_WARN("comphelper.traceevent", "Incorrect ProfileZone nesting for " << m_sName);
}