diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2017-12-12 20:54:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-23 15:04:38 (GMT) |
commit | 695951bc46fa4bc4eaf686c4ee6dce24c579bc45 (patch) | |
tree | 951a8e3d7f78d9cb9ec892a35fd15dab1a4f9d97 /Source/CTest/cmProcess.h | |
parent | 9c52b587b6dfa54266bcebbe7e111d7dde437a75 (diff) | |
download | CMake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.zip CMake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.tar.gz CMake-695951bc46fa4bc4eaf686c4ee6dce24c579bc45.tar.bz2 |
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/cmProcess.h')
-rw-r--r-- | Source/CTest/cmProcess.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h index 633be24..20e24b9 100644 --- a/Source/CTest/cmProcess.h +++ b/Source/CTest/cmProcess.h @@ -4,6 +4,7 @@ #define cmProcess_h #include "cmConfigure.h" // IWYU pragma: keep +#include "cmDuration.h" #include "cmProcessOutput.h" #include "cmUVHandlePtr.h" @@ -31,8 +32,8 @@ public: void SetCommand(const char* command); void SetCommandArguments(std::vector<std::string> const& arg); void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir; } - void SetTimeout(std::chrono::duration<double> t) { this->Timeout = t; } - void ChangeTimeout(std::chrono::duration<double> t); + void SetTimeout(cmDuration t) { this->Timeout = t; } + void ChangeTimeout(cmDuration t); void ResetStartTime(); // Return true if the process starts bool StartProcess(uv_loop_t& loop); @@ -53,7 +54,7 @@ public: int GetId() { return this->Id; } void SetId(int id) { this->Id = id; } int GetExitValue() { return this->ExitValue; } - std::chrono::duration<double> GetTotalTime() { return this->TotalTime; } + cmDuration GetTotalTime() { return this->TotalTime; } enum class Exception { @@ -69,9 +70,9 @@ public: std::string GetExitExceptionString(); private: - std::chrono::duration<double> Timeout; + cmDuration Timeout; std::chrono::steady_clock::time_point StartTime; - std::chrono::duration<double> TotalTime; + cmDuration TotalTime; bool ReadHandleClosed = false; bool ProcessHandleClosed = false; |