From 062b407e7c90f9224582007f8e30e809aa25e41d Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Wed, 28 Apr 2021 17:49:55 +1000 Subject: Feature [feature-requests:1373]. Use steady_clock for measuring intervals. --- src/ElapsedPeriod.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ElapsedPeriod.h b/src/ElapsedPeriod.h index e083c0dda..3f05dc88d 100644 --- a/src/ElapsedPeriod.h +++ b/src/ElapsedPeriod.h @@ -12,15 +12,15 @@ namespace Scintilla { // Simplified access to high precision timing. class ElapsedPeriod { - std::chrono::high_resolution_clock::time_point tp; + using ElapsedClock = std::chrono::steady_clock; + ElapsedClock::time_point tp; public: /// Capture the moment - ElapsedPeriod() noexcept : tp(std::chrono::high_resolution_clock::now()) { + ElapsedPeriod() noexcept : tp(ElapsedClock::now()) { } /// Return duration as floating point seconds double Duration(bool reset=false) noexcept { - const std::chrono::high_resolution_clock::time_point tpNow = - std::chrono::high_resolution_clock::now(); + const ElapsedClock::time_point tpNow = ElapsedClock::now(); const std::chrono::duration stylingDuration = std::chrono::duration_cast>(tpNow - tp); if (reset) { -- cgit v1.2.3