diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2017-12-12 20:54:01 +0000 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-23 10:04:38 -0500 |
commit | 695951bc46fa4bc4eaf686c4ee6dce24c579bc45 (patch) | |
tree | 951a8e3d7f78d9cb9ec892a35fd15dab1a4f9d97 /Source/CTest/cmCTestScriptHandler.cxx | |
parent | 9c52b587b6dfa54266bcebbe7e111d7dde437a75 (diff) | |
download | cmake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.tar.gz |
CTest: introduce cmDuration
This commit introduces cmDuration as a typedef for
std::chrono::duration<double, std::ratio<1>>. It is less verbose and
provides for a point to put future common functionality for durations.
No functional change intended.
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 716ea1035b..d5faeb5cb8 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -558,8 +558,8 @@ int cmCTestScriptHandler::RunCurrentScript() // for a continuous, do we ned to run it more than once? if (this->ContinuousDuration >= 0) { this->UpdateElapsedTime(); - auto ending_time = std::chrono::steady_clock::now() + - std::chrono::duration<double>(this->ContinuousDuration); + auto ending_time = + std::chrono::steady_clock::now() + cmDuration(this->ContinuousDuration); if (this->EmptyBinDirOnce) { this->EmptyBinDir = true; } @@ -567,8 +567,7 @@ int cmCTestScriptHandler::RunCurrentScript() auto startOfInterval = std::chrono::steady_clock::now(); result = this->RunConfigurationDashboard(); auto interval = std::chrono::steady_clock::now() - startOfInterval; - auto minimumInterval = - std::chrono::duration<double>(this->MinimumInterval); + auto minimumInterval = cmDuration(this->MinimumInterval); if (interval < minimumInterval) { auto sleepTime = std::chrono::duration_cast<std::chrono::seconds>( minimumInterval - interval) @@ -960,7 +959,7 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce( return cmSystemTools::RemoveADirectory(directoryPath); } -std::chrono::duration<double> cmCTestScriptHandler::GetRemainingTimeAllowed() +cmDuration cmCTestScriptHandler::GetRemainingTimeAllowed() { if (!this->Makefile) { return cmCTest::MaxDuration(); @@ -972,9 +971,9 @@ std::chrono::duration<double> cmCTestScriptHandler::GetRemainingTimeAllowed() return cmCTest::MaxDuration(); } - auto timelimit = std::chrono::duration<double>(atof(timelimitS)); + auto timelimit = cmDuration(atof(timelimitS)); - auto duration = std::chrono::duration_cast<std::chrono::duration<double>>( + auto duration = std::chrono::duration_cast<cmDuration>( std::chrono::steady_clock::now() - this->ScriptStartTime); return (timelimit - duration); } |