Accept long time
This commit is contained in:
parent
45ce5f8404
commit
d46117cda1
1 changed files with 16 additions and 9 deletions
|
|
@ -39,27 +39,34 @@ class eoTimeCounter : public eoUpdater, public eoValueParam<double>
|
|||
{
|
||||
public:
|
||||
eoTimeCounter() : eoValueParam<double>(0.0, "Time") // : firstTime(true)
|
||||
{}
|
||||
|
||||
{
|
||||
start = time(NULL);
|
||||
}
|
||||
|
||||
/** simply stores the time spent in process in its value() */
|
||||
virtual void operator()()
|
||||
{
|
||||
// ask for system time
|
||||
utime = clock();
|
||||
// if (firstTime) /* first generation */
|
||||
// {
|
||||
// firstTime=false;
|
||||
// firstUtime = tmsStruct.tms_utime;
|
||||
// }
|
||||
|
||||
// if (firstTime) /* first generation */
|
||||
// {
|
||||
// firstTime=false;
|
||||
// firstUtime = tmsStruct.tms_utime;
|
||||
// }
|
||||
// store elapsed user time
|
||||
// value(tmsStruct.tms_utime - firstUtime);
|
||||
value()=double(utime)/CLOCKS_PER_SEC;
|
||||
// value(tmsStruct.tms_utime - firstUtime);
|
||||
// value()=double(utime)/CLOCKS_PER_SEC;
|
||||
double seconds_elapsed = time(NULL) - start;
|
||||
|
||||
value() = (seconds_elapsed > 2140) ? seconds_elapsed : double(utime)/CLOCKS_PER_SEC;
|
||||
}
|
||||
|
||||
private:
|
||||
// bool firstTime;
|
||||
// clock_t firstUtime;
|
||||
clock_t utime;
|
||||
time_t start;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Reference in a new issue