diff options
| author | Zufu Liu <unknown> | 2021-04-28 17:49:55 +1000 | 
|---|---|---|
| committer | Zufu Liu <unknown> | 2021-04-28 17:49:55 +1000 | 
| commit | 062b407e7c90f9224582007f8e30e809aa25e41d (patch) | |
| tree | 67dcfa4f6e10997cf6065fe5f2148f64c610c6af /src | |
| parent | c84506e472724377b9e8e4038eee15629046f942 (diff) | |
| download | scintilla-mirror-062b407e7c90f9224582007f8e30e809aa25e41d.tar.gz | |
Feature [feature-requests:1373]. Use steady_clock for measuring intervals.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ElapsedPeriod.h | 8 | 
1 files changed, 4 insertions, 4 deletions
| 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<double> stylingDuration =  			std::chrono::duration_cast<std::chrono::duration<double>>(tpNow - tp);  		if (reset) { | 
