From c57d6d39c80844c9d4c6bfed85cc151e52a67b34 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 3 Mar 2020 21:01:58 +0100 Subject: comphelper: allow simple ad-hoc measuring with ProfileZones And then remove the manual measuring from the RTF import. Sample output: comphelper::ProfileZone: RtfFilter::filter finished in 180 ms Change-Id: I85e2e12d82ff491a2991a41e5a6f6d1410e12363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89905 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- comphelper/source/misc/profilezone.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'comphelper') diff --git a/comphelper/source/misc/profilezone.cxx b/comphelper/source/misc/profilezone.cxx index ff76a4f35e8d..5abcca8a80b3 100644 --- a/comphelper/source/misc/profilezone.cxx +++ b/comphelper/source/misc/profilezone.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -98,6 +99,14 @@ css::uno::Sequence getRecordingAndClear() } // namespace ProfileRecording +void ProfileZone::startConsole() { m_aCreateTime = osl_getGlobalTimer(); } + +void ProfileZone::stopConsole() +{ + sal_uInt32 nEndTime = osl_getGlobalTimer(); + std::cerr << "comphelper::ProfileZone: " << m_sProfileId << " finished in " + << nEndTime - m_aCreateTime << " ms" << std::endl; +} } // namespace comphelper -- cgit