aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-26 08:19:32 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-26 08:19:32 +1000
commitf4fdffef1425b7a4293a90fb96219a58b2158019 (patch)
treec23cc3904df927a7b9dfb1bbddcf022228f1351d /win32/PlatWin.cxx
parent9172c913efbc014349c97740476d019690e57791 (diff)
downloadscintilla-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 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx48
1 files changed, 0 insertions, 48 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 4f7d59562..ec215bb38 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -2901,54 +2901,6 @@ void Menu::Show(Point pt, Window &w) {
Destroy();
}
-static bool initialisedET = false;
-static bool usePerformanceCounter = false;
-static LARGE_INTEGER frequency;
-
-ElapsedTime::ElapsedTime() {
- if (!initialisedET) {
- usePerformanceCounter = ::QueryPerformanceFrequency(&frequency) != 0;
- initialisedET = true;
- }
- if (usePerformanceCounter) {
- LARGE_INTEGER timeVal;
- ::QueryPerformanceCounter(&timeVal);
- bigBit = timeVal.HighPart;
- littleBit = timeVal.LowPart;
- } else {
- bigBit = clock();
- littleBit = 0;
- }
-}
-
-double ElapsedTime::Duration(bool reset) {
- double result;
- long endBigBit;
- long endLittleBit;
-
- if (usePerformanceCounter) {
- LARGE_INTEGER lEnd;
- ::QueryPerformanceCounter(&lEnd);
- endBigBit = lEnd.HighPart;
- endLittleBit = lEnd.LowPart;
- LARGE_INTEGER lBegin;
- lBegin.HighPart = bigBit;
- lBegin.LowPart = littleBit;
- const double elapsed = static_cast<double>(lEnd.QuadPart - lBegin.QuadPart);
- result = elapsed / static_cast<double>(frequency.QuadPart);
- } else {
- endBigBit = clock();
- endLittleBit = 0;
- const double elapsed = endBigBit - bigBit;
- result = elapsed / CLOCKS_PER_SEC;
- }
- if (reset) {
- bigBit = endBigBit;
- littleBit = endLittleBit;
- }
- return result;
-}
-
class DynamicLibraryImpl : public DynamicLibrary {
protected:
HMODULE h;