Changeset 251 in svn for trunk/Utilities/ExRootAnalysis/src/ExRootProgressBar.cc
- Timestamp:
- Feb 7, 2009, 4:44:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/ExRootAnalysis/src/ExRootProgressBar.cc
r220 r251 4 4 * Class showing progress bar 5 5 * 6 * $Date: 2009-02-0 2 11:32:01$7 * $Revision: 1. 2$6 * $Date: 2009-02-07 15:44:02 $ 7 * $Revision: 1.3 $ 8 8 * 9 9 * … … 15 15 #include "TSystem.h" 16 16 #include <cstdio> 17 #include <iostream> 17 18 18 19 using namespace std; … … 31 32 ExRootProgressBar::~ExRootProgressBar() 32 33 { 33 if(fBar) delete[] fBar;34 if(fBar) delete[] fBar; 34 35 } 35 36 … … 40 41 ULong_t time = gSystem->Now(); 41 42 42 if(time < fTime + 1000 && entry < fEntries - 1) return;43 if(time < fTime + 500 && entry < fEntries - 1) return; 43 44 44 45 fTime = time; … … 48 49 if(hashes > fHashes) 49 50 { 50 memset(fBar + fHashes, ' #', hashes - fHashes);51 memset(fBar + fHashes, '$', hashes - fHashes); 51 52 fHashes = hashes; 52 53 } 54 float frac=(entry + 1.0)/fEntries*100.0; 55 if(frac<10) fprintf(stdout, "** [%s] %.2f%% processed **\r", fBar,(entry + 1.0)/fEntries*100.0); 56 if(frac==100) fprintf(stdout, "** [%s] %.2f%% processed **\r", fBar,(entry + 1.0)/fEntries*100.0); 57 else fprintf(stdout, "** [%s] %.2f%% processed **\r", fBar,(entry + 1.0)/fEntries*100.0); 58 fflush(stdout); 53 59 54 /* 55 cerr << "[" << fBar << "] ("; 56 cerr.setf(ios::fixed); 57 cerr.precision(2); 58 cerr << (entry + 1.0)/fEntries*100.0 << "%) : "; 59 cerr << entry + 1 << "/" << fEntries; 60 cerr << " events processed\r" << flush; 61 */ 62 63 fprintf(stderr, "[%s] (%.2f%%) : %lli/%lli entries processed\r", fBar, 64 (entry + 1.0)/fEntries*100.0, entry + 1, fEntries); 65 fflush(stderr); 60 if(entry+1==fEntries) 61 { 62 char temp[500]; 63 sprintf(temp, "** [%s] %.2f%% processed ", fBar,(entry + 1.0)/fEntries*100.0); 64 string mystringName(temp); 65 cout << mystringName <<endl; 66 } 66 67 } 67 68
Note:
See TracChangeset
for help on using the changeset viewer.