HG-MD
1
|
estimates the time in seconds when tmax should be reached More...
#include <Time.h>
Public Member Functions | |
void | set (Mdouble t, Mdouble tmax) |
Mdouble | getTime2Finish (Mdouble t) |
string | getFinishTime (Mdouble t) |
Private Attributes | |
clock_t | start |
Mdouble | t_ |
Mdouble | tmax_ |
estimates the time in seconds when tmax should be reached
string Time2Finish::getFinishTime | ( | Mdouble | t | ) | [inline] |
{ Mdouble time2Finish = getTime2Finish(t); time_t finish = time(NULL) + time2Finish; stringstream ss; //write estimated end time ss << ctime(&finish); //decrement put pointer by one to avoid line break ss.seekp((long)ss.tellp()-1); //write time to finish ss << " (" << time2Finish/3600 << "h)"; return ss.str(); }
Mdouble Time2Finish::getTime2Finish | ( | Mdouble | t | ) | [inline] |
clock_t Time2Finish::start [private] |
Mdouble Time2Finish::t_ [private] |
Mdouble Time2Finish::tmax_ [private] |