summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/traceevent.cxx2
-rw-r--r--include/comphelper/profilezone.hxx14
2 files changed, 6 insertions, 10 deletions
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
index 6e86c3f03993..325ba59b131d 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -120,8 +120,6 @@ void ProfileZone::addRecording()
+ OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
}
-void ProfileZone::startConsole() { m_nCreateTime = osl_getGlobalTimer(); }
-
void ProfileZone::stopConsole()
{
sal_uInt32 nEndTime = osl_getGlobalTimer();
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
index 4bdd6ad53fb5..32dc02e14f74 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -23,7 +23,6 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public TraceEvent
const char* m_sProfileId;
long long m_nCreateTime;
bool m_bConsole;
- void startConsole();
void stopConsole();
int m_nPid;
@@ -49,13 +48,18 @@ public:
: m_sProfileId(sProfileId ? sProfileId : "(null)")
, m_bConsole(bConsole)
{
- if (s_bRecording)
+ if (s_bRecording || m_bConsole)
{
TimeValue systemTime;
osl_getSystemTime(&systemTime);
m_nCreateTime
= static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec / 1000;
+ }
+ else
+ m_nCreateTime = 0;
+ if (s_bRecording)
+ {
oslProcessInfo aProcessInfo;
aProcessInfo.Size = sizeof(oslProcessInfo);
if (osl_getProcessInfo(nullptr, osl_Process_IDENTIFIER, &aProcessInfo)
@@ -64,12 +68,6 @@ public:
s_nNesting++;
}
- else
- m_nCreateTime = 0;
- if (m_bConsole)
- {
- startConsole();
- }
}
~ProfileZone()