diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-26 08:19:32 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-26 08:19:32 +1000 |
commit | f4fdffef1425b7a4293a90fb96219a58b2158019 (patch) | |
tree | c23cc3904df927a7b9dfb1bbddcf022228f1351d /qt/ScintillaEditBase/PlatQt.cpp | |
parent | 9172c913efbc014349c97740476d019690e57791 (diff) | |
download | scintilla-mirror-f4fdffef1425b7a4293a90fb96219a58b2158019.tar.gz |
Use <chrono> for platform-independent timing and remove ElapsedTime.
Also use #if for painting measurement as there are 7 sections of code to enable.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
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 <QTextLayout> #include <QTextLine> #include <QLibrary> -#include <QElapsedTimer> #include <cstdio> 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<unsigned long>(ns64Now >> 32); - littleBit = static_cast<unsigned long>(ns64Now & 0xFFFFFFFF); -} - -double ElapsedTime::Duration(bool reset) -{ - qint64 ns64Now = timer.nsecsElapsed(); - qint64 ns64Start = (static_cast<qint64>(static_cast<unsigned long>(bigBit)) << 32) + static_cast<unsigned long>(littleBit); - double result = ns64Now - ns64Start; - if (reset) { - bigBit = static_cast<unsigned long>(ns64Now >> 32); - littleBit = static_cast<unsigned long>(ns64Now & 0xFFFFFFFF); - } - return result / 1000000000.0; // 1 billion nanoseconds in a second -} - } |