[Libreoffice-commits] core.git: comphelper/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 26 17:25:20 UTC 2021
comphelper/source/misc/traceevent.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 9c787b1e5ad517476a26fc9735ac63b54bfa28a4
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed May 26 18:27:06 2021 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed May 26 19:24:36 2021 +0200
comphelper: fix the "console" use-case of ProfileZone
m_nCreateTime was changed to NS, nEndTime was still MS, comparing the
two is not a great idea.
Change-Id: I102990838d1e3d543a356b5ad2d3f68ce1d20623
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116210
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
index 81039c9ca82d..3a2e1b012c4c 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -121,9 +121,12 @@ void ProfileZone::addRecording()
void ProfileZone::stopConsole()
{
- sal_uInt32 nEndTime = osl_getGlobalTimer();
+ TimeValue systemTime;
+ osl_getSystemTime(&systemTime);
+ long long nEndTime
+ = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec / 1000;
std::cerr << "comphelper::ProfileZone: " << m_sName << " finished in "
- << nEndTime - m_nCreateTime << " ms" << std::endl;
+ << (nEndTime - m_nCreateTime) / 1000 << " ms" << std::endl;
}
} // namespace comphelper
More information about the Libreoffice-commits
mailing list