From 724309f4b71d1d991a754d0ad821de3861b6a211 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sun, 6 May 2018 21:22:30 -0400 Subject: Backport: Use for platform-independent timing and remove ElapsedTime. Also use #if for painting measurement as there are 7 sections of code to enable. Backport of changeset 6741:af5d9064c25c. --- qt/ScintillaEditBase/PlatQt.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'qt/ScintillaEditBase/PlatQt.cpp') diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index fb7904f05..f1857e662 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include namespace Scintilla { @@ -1210,30 +1209,4 @@ void Platform::Assert(const char *c, const char *file, int line) } } -//---------------------------------------------------------------------- - -static QElapsedTimer timer; - -ElapsedTime::ElapsedTime() : bigBit(0), littleBit(0) -{ - if (!timer.isValid()) { - timer.start(); - } - qint64 ns64Now = timer.nsecsElapsed(); - bigBit = static_cast(ns64Now >> 32); - littleBit = static_cast(ns64Now & 0xFFFFFFFF); -} - -double ElapsedTime::Duration(bool reset) -{ - qint64 ns64Now = timer.nsecsElapsed(); - qint64 ns64Start = (static_cast(static_cast(bigBit)) << 32) + static_cast(littleBit); - double result = ns64Now - ns64Start; - if (reset) { - bigBit = static_cast(ns64Now >> 32); - littleBit = static_cast(ns64Now & 0xFFFFFFFF); - } - return result / 1000000000.0; // 1 billion nanoseconds in a second -} - } -- cgit v1.2.3