72#define STDERR_FILENO 2
85 :
Timer(0, prefix, colourfulOutput)
155 Double_t leftTime = ( icounts <= 0 ? -1 :
170 std::clog <<
fLogger->GetPrintedSource();
171 std::clog <<
"Please wait ";
174 std::clog <<
"." << std::flush;
183 std::clog <<
fLogger->GetPrintedSource();
193 std::clog <<
"\r" << std::flush;
207 if (icounts < 0 ) icounts = 0;
217 std::clog <<
Int_t((100*(icounts+1))/
Float_t(
fNcounts)) <<
"%, time left: " << timeLeft << std::endl;
225 std::clog <<
fLogger->GetPrintedSource();
227 else std::clog <<
"[";
228 for (
Int_t i=0; i<ic; i++) {
230 else std::clog <<
">";
234 else std::clog <<
".";
237 else std::clog <<
"]" ;
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).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
ostringstream derivative to redirect and format output
TString fPrefix
prefix for outputs
Bool_t fColourfulOutput
flag for use of colors
Double_t ElapsedSeconds(void)
computes elapsed tim in seconds
TString fPreviousTimeEstimate
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
MsgLogger * fLogger
! the output logger
Timer(const char *prefix="", Bool_t colourfulOutput=kTRUE)
constructor
void Reset(void)
resets timer
virtual ~Timer(void)
destructor
Int_t fProgressBarStringLength
static const TString fgClassName
used for output
Int_t fNcounts
reference number of "counts"
TString GetElapsedTime(Bool_t Scientific=kTRUE)
returns pretty string with elapsed time
void DrawProgressBar(Int_t, const TString &comment="")
draws progress bar in color or B&W caution:
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.