summaryrefslogtreecommitdiff
path: root/include/comphelper/profilezone.hxx
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2017-03-28 16:32:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-06-15 16:10:09 +0200
commit81413799eb4f38d62710b295268249307364000a (patch)
tree6468fba4268090a7623b10cd655cd41d43188e3d /include/comphelper/profilezone.hxx
parent9863be5254fcce6b74da30b821e9263002e9ac71 (diff)
comphelper: add a profiling API
Using the guard style ProfileZone aZone("foo"). Test macro: Sub TimeLog toolkit = createUnoService("com.sun.star.awt.Toolkit") toolkit.startRecording() toolkit.processEventsToIdle() toolkit.stopRecording() a = toolkit.getRecordingAndClear() s = "" For Each i in a s = s + i + ", " Next i Print s End Sub Change-Id: Iceaf9143d0387c87e7936dc67eecbbf71ee8d74a Reviewed-on: https://gerrit.libreoffice.org/38786 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include/comphelper/profilezone.hxx')
-rw-r--r--include/comphelper/profilezone.hxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
new file mode 100644
index 000000000000..0c64ed7bfee4
--- /dev/null
+++ b/include/comphelper/profilezone.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#ifndef INCLUDED_COMPHELPER_PROFILEZONE_HXX
+#define INCLUDED_COMPHELPER_PROFILEZONE_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <comphelper/comphelperdllapi.h>
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+
+#include <vector>
+
+// implementation of XToolkitExperimental profiling API
+
+namespace comphelper
+{
+
+namespace ProfileRecording
+{
+
+COMPHELPER_DLLPUBLIC void startRecording(bool bRecording = true);
+
+COMPHELPER_DLLPUBLIC long long addRecording(const char * aProfileId, long long aCreateTime);
+
+COMPHELPER_DLLPUBLIC css::uno::Sequence<OUString> getRecordingAndClear();
+
+} // namespace ProfileRecording
+
+class COMPHELPER_DLLPUBLIC ProfileZone
+{
+private:
+ const char * m_sProfileId;
+ long long m_aCreateTime;
+public:
+ ProfileZone(const char * sProfileId);
+ ~ProfileZone();
+};
+
+} // namespace comphelper
+
+
+#endif // INCLUDED_COMPHELPER_PROFILEZONE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */