Warning, file /include/root/TMVA/Timer.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef ROOT_TMVA_Timer
0029 #define ROOT_TMVA_Timer
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #ifndef ROOT_time
0040 #include "time.h"
0041 #endif
0042 #include "TString.h"
0043 #include "TStopwatch.h"
0044
0045
0046 #if defined(__SUNPRO_CC) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 == 500 )
0047 #ifndef _CLOCK_T
0048 #define _CLOCK_T
0049 typedef long clock_t;
0050 #endif
0051
0052 #endif
0053
0054 namespace TMVA {
0055
0056 class MsgLogger;
0057
0058 class Timer : public TStopwatch {
0059
0060 public:
0061
0062 Timer( const char* prefix = "", Bool_t colourfulOutput = kTRUE );
0063 Timer( Int_t ncounts, const char* prefix = "", Bool_t colourfulOutput = kTRUE );
0064 virtual ~Timer( void );
0065
0066 void Init ( Int_t ncounts );
0067 void Reset( void );
0068
0069
0070
0071 TString GetElapsedTime ( Bool_t Scientific = kTRUE );
0072 Double_t ElapsedSeconds ( void );
0073 TString GetLeftTime ( Int_t icounts );
0074 void DrawProgressBar( Int_t, const TString& comment = "" );
0075 void DrawProgressBar( TString );
0076 void DrawProgressBar( void );
0077
0078 private:
0079
0080 TString SecToText ( Double_t, Bool_t ) const;
0081
0082 Int_t fNcounts;
0083 TString fPrefix;
0084 Bool_t fColourfulOutput;
0085
0086
0087 Int_t fPreviousProgress;
0088 TString fPreviousTimeEstimate;
0089 Bool_t fOutputToFile;
0090
0091 Int_t fProgressBarStringLength;
0092
0093 static const TString fgClassName;
0094 static const Int_t fgNbins;
0095
0096 mutable MsgLogger* fLogger;
0097 MsgLogger& Log() const { return *fLogger; }
0098
0099 ClassDef(Timer,0);
0100 };
0101
0102 }
0103
0104 #endif