Accept long time

This commit is contained in:
paradiseo 2009-06-25 14:49:53 +00:00
commit d46117cda1

View file

@ -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