diff options
| author | mitchell <unknown> | 2018-05-06 21:22:30 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2018-05-06 21:22:30 -0400 |
| commit | 724309f4b71d1d991a754d0ad821de3861b6a211 (patch) | |
| tree | f24a11e3c550ad8ba46b92089a2ef1d3aff34663 /win32/PlatWin.cxx | |
| parent | 8971ac9fe89f01e717ad21126213ac8887fe373d (diff) | |
| download | scintilla-mirror-724309f4b71d1d991a754d0ad821de3861b6a211.tar.gz | |
Backport: Use <chrono> 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.
Diffstat (limited to 'win32/PlatWin.cxx')
| -rw-r--r-- | win32/PlatWin.cxx | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 487ae055b..07759abf2 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2902,54 +2902,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; |
