72#define STDERR_FILENO 2
99 fPreviousProgress(-1),
101 fProgressBarStringLength (0),
129 fPreviousProgress = -1;
130 fPreviousTimeEstimate.Clear();
147 return SecToText( ElapsedSeconds(),
Scientific );
167 fProgressBarStringLength = 0;
170 std::clog << fLogger->GetPrintedSource();
171 std::clog <<
"Please wait ";
174 std::clog <<
"." << std::flush;
183 std::clog << fLogger->GetPrintedSource();
191 for (
int i = fProgressBarStringLength; i <
theString.Length (); ++i)
193 std::clog <<
"\r" << std::flush;
194 fProgressBarStringLength =
theString.Length ();
203 if (!
gConfig().DrawProgressBar())
return;
213 if (
ic == fPreviousProgress &&
timeLeft == fPreviousTimeEstimate &&
icounts != fNcounts-1)
return;
216 if (
ic != fPreviousProgress) {
218 fPreviousProgress =
ic;
222 fPreviousProgress =
ic;
225 std::clog << fLogger->GetPrintedSource();
227 else std::clog <<
"[";
230 else std::clog <<
">";
232 for (
Int_t i=
ic+1; i<fgNbins; i++) {
234 else std::clog <<
".";
237 else std::clog <<
"]" ;
240 if (fColourfulOutput) {
250 <<
", " <<
"time left: " <<
timeLeft <<
") ";
253 std::clog <<
"[" << comment <<
"] ";
255 std::clog <<
"\r" << std::flush;
265 else if (seconds < 0 ) out =
"unknown";
268 if (seconds > 3600) {
273 seconds =
Int_t(seconds)%3600;
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Reset(Option_t *option="") override
ostringstream derivative to redirect and format output
Timing information for training and evaluation of MVA methods.
Bool_t fColourfulOutput
flag for use of colors
Double_t ElapsedSeconds(void)
computes elapsed tim in seconds
static const Int_t fgNbins
number of bins in progress bar
void DrawProgressBar(void)
draws the progressbar
TString SecToText(Double_t, Bool_t) const
pretty string output
TString GetLeftTime(Int_t icounts)
returns pretty string with time left
Timer(const char *prefix="", Bool_t colourfulOutput=kTRUE)
constructor
void Reset(void)
resets timer
virtual ~Timer(void)
destructor
static const TString fgClassName
used for output
TString GetElapsedTime(Bool_t Scientific=kTRUE)
returns pretty string with elapsed time
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.