diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2017-11-03 13:25:33 +0000 |
---|---|---|
committer | Wouter Klouwen <wouter.klouwen@youview.com> | 2017-11-14 13:30:14 +0000 |
commit | e8a4036e9621d567fa47a118aa5583f85fae811a (patch) | |
tree | 904b467a4470c1d48d435334b8406902bac690b3 /Source/CTest/cmCTestScriptHandler.h | |
parent | b77501d4c7341337174f29cae623d8e1905af29a (diff) | |
download | cmake-e8a4036e9621d567fa47a118aa5583f85fae811a.tar.gz |
CTest: use std::chrono::steady_clock for time keeping
It was reported in issue #17345 that CTest does not use monotonic time
to report test duration. Monotonic clocks are not affected by large NTP
adjustments or things like daylight savings time.
As CMake 3.10 requires C++11, which introduced std::chrono, this commit
moves the time keeping in CTest from cmSystemTools::GetTime() to
std::chrono::steady_clock.
Fixes: #17345
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.h')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index b6cd97b736..2090d04bb3 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -7,6 +7,7 @@ #include "cmCTestGenericHandler.h" +#include <chrono> #include <string> #include <vector> @@ -104,6 +105,7 @@ public: void CreateCMake(); cmake* GetCMake() { return this->CMake; } + private: // reads in a script int ReadInScript(const std::string& total_script_arg); @@ -156,7 +158,7 @@ private: double ContinuousDuration; // what time in seconds did this script start running - double ScriptStartTime; + std::chrono::steady_clock::time_point ScriptStartTime; cmMakefile* Makefile; cmGlobalGenerator* GlobalGenerator; |