72#define STDERR_FILENO 2
100 fPreviousProgress(-1),
102 fProgressBarStringLength (0),
130 fPreviousProgress = -1;
131 fPreviousTimeEstimate.Clear();
148 return SecToText( ElapsedSeconds(),
Scientific );
168 fProgressBarStringLength = 0;
171 std::clog << fLogger->GetPrintedSource();
172 std::clog <<
"Please wait ";
175 std::clog <<
"." << std::flush;
184 std::clog << fLogger->GetPrintedSource();
192 for (
int i = fProgressBarStringLength; i <
theString.Length (); ++i)
194 std::clog <<
"\r" << std::flush;
195 fProgressBarStringLength =
theString.Length ();
204 if (!
gConfig().DrawProgressBar())
return;
214 if (
ic == fPreviousProgress &&
timeLeft == fPreviousTimeEstimate &&
icounts != fNcounts-1)
return;
217 if (
ic != fPreviousProgress) {
219 fPreviousProgress =
ic;
223 fPreviousProgress =
ic;
226 std::clog << fLogger->GetPrintedSource();
228 else std::clog <<
"[";
231 else std::clog <<
">";
233 for (
Int_t i=
ic+1; i<fgNbins; i++) {
235 else std::clog <<
".";
238 else std::clog <<
"]" ;
241 if (fColourfulOutput) {
251 <<
", " <<
"time left: " <<
timeLeft <<
") ";
254 std::clog <<
"[" << comment <<
"] ";
256 std::clog <<
"\r" << std::flush;
266 else if (seconds < 0 ) out =
"unknown";
269 if (seconds > 3600) {
274 seconds =
Int_t(seconds)%3600;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.