summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2016-07-01 10:47:28 +0200
committerDavid Schulz <david.schulz@qt.io>2016-07-07 12:17:54 +0000
commitf664cbb514515992c287027acc96130bc4f9b486 (patch)
treec41725fd37eb14c23c7ff99eb617f583db1ad489
parent4133ff0ab6235779eb9427be85357dab08dd0bab (diff)
downloadqt-creator-f664cbb514515992c287027acc96130bc4f9b486.tar.gz
Cdb: Add benchmark to cdbextension
Change-Id: I830f5997f230435c400c0e688420af915263027a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/libs/qtcreatorcdbext/common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs/qtcreatorcdbext/common.h b/src/libs/qtcreatorcdbext/common.h
index 0bfbcda038..b538313b3f 100644
--- a/src/libs/qtcreatorcdbext/common.h
+++ b/src/libs/qtcreatorcdbext/common.h
@@ -63,6 +63,18 @@ struct DebugPrint : public std::ostringstream {
}
};
+struct Bench
+{
+ Bench(const std::string &what) : m_initialTickCount(GetTickCount()), m_what(what) {}
+ ~Bench()
+ {
+ DebugPrint() << m_what << " took "
+ << GetTickCount() - m_initialTickCount << "ms to execute." << std::endl;
+ }
+ const DWORD m_initialTickCount;
+ const std::string m_what;
+};
+
ULONG currentThreadId(IDebugSystemObjects *sysObjects);
ULONG currentThreadId(CIDebugClient *client);
ULONG currentProcessId(IDebugSystemObjects *sysObjects);