ENH: add start end time for procs
This commit is contained in:
parent
38b7b3fea0
commit
ede2be4be1
|
@ -16,6 +16,7 @@
|
||||||
=========================================================================*/
|
=========================================================================*/
|
||||||
|
|
||||||
#include <cmProcess.h>
|
#include <cmProcess.h>
|
||||||
|
#include <cmSystemTools.h>
|
||||||
|
|
||||||
cmProcess::cmProcess()
|
cmProcess::cmProcess()
|
||||||
{
|
{
|
||||||
|
@ -43,6 +44,7 @@ bool cmProcess::StartProcess()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
this->StartTime = cmSystemTools::GetTime();
|
||||||
this->ProcessArgs.clear();
|
this->ProcessArgs.clear();
|
||||||
// put the command as arg0
|
// put the command as arg0
|
||||||
this->ProcessArgs.push_back(this->Command.c_str());
|
this->ProcessArgs.push_back(this->Command.c_str());
|
||||||
|
@ -210,6 +212,8 @@ bool cmProcess::IsRunning()
|
||||||
// if the process is done, then wait for it to exit
|
// if the process is done, then wait for it to exit
|
||||||
cmsysProcess_WaitForExit(this->Process, 0);
|
cmsysProcess_WaitForExit(this->Process, 0);
|
||||||
this->ExitValue = cmsysProcess_GetExitValue(this->Process);
|
this->ExitValue = cmsysProcess_GetExitValue(this->Process);
|
||||||
|
this->TotalTime = cmSystemTools::GetTime() - this->StartTime;
|
||||||
|
// std::cerr << "Time to run: " << this->TotalTime << "\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ public:
|
||||||
private:
|
private:
|
||||||
int LastOutputPipe;
|
int LastOutputPipe;
|
||||||
double Timeout;
|
double Timeout;
|
||||||
|
double StartTime;
|
||||||
|
double TotalTime;
|
||||||
cmsysProcess* Process;
|
cmsysProcess* Process;
|
||||||
std::vector<char> StdErrorBuffer;
|
std::vector<char> StdErrorBuffer;
|
||||||
std::vector<char> StdOutBuffer;
|
std::vector<char> StdOutBuffer;
|
||||||
|
|
Loading…
Reference in New Issue