From f664cbb514515992c287027acc96130bc4f9b486 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 1 Jul 2016 10:47:28 +0200 Subject: [PATCH] Cdb: Add benchmark to cdbextension Change-Id: I830f5997f230435c400c0e688420af915263027a Reviewed-by: Christian Stenger --- src/libs/qtcreatorcdbext/common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libs/qtcreatorcdbext/common.h b/src/libs/qtcreatorcdbext/common.h index 0bfbcda0384..b538313b3f7 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);