24 if (currentTimingReport==0) currentTimingReport =
new TimingReport();
25 return currentTimingReport;
42 for (;p!=
e; ++
p) (*p).second.switchOn(
on);
52 typedef std::map<std::string, Item *, std::less<std::string> > LMAP;
58 if ( (*p).second.on && (!active||(*p).second.active()) )
59 lreg[(*p).first] = &(*p).second;
64 std::ostream co(ico.rdbuf());
67 if (active) co <<
"Active ";
68 co <<
"Timing Report (in "
69 << (
inTicks() ?
"ticks" :
"seconds") <<
")\n" << std::endl;
70 LMAP::iterator
p = lreg.begin();
71 LMAP::iterator
e = lreg.end();
72 while (p!=e) { namew =
std::max(namew,(*p).first.size()); ++
p;}
75 co.setf(std::ios::left,std::ios::adjustfield);
77 co << std::setiosflags(std::ios::showpoint)
78 << std::setprecision(3);
80 co << std::setiosflags(std::ios::showpoint | std::ios::fixed)
81 << std::setprecision(3);
83 co << std::setw(namew) << (*p).first.c_str() <<
" ";
84 co.setf(std::ios::right,std::ios::adjustfield);
85 co << std::setw(10) << (*(*p).second).counter <<
" ";
87 << (
inTicks() ? (*(*p).second).realticks()
88 : (*(*p).second).realsec() ) <<
" (real)";
90 co <<
" " << std::setw(10)
96 co <<
"\n" << std::endl;
static double bias(bool insec=true, unsigned int n=5000)
bool & inTicks()
report in ticks
static double ticksInSec()
Time::TimeInterval lap() const
const T & max(const T &a, const T &b)
static TimingReport * current()
void switchOn(bool ion)
switch all on
void dump(std::ostream &co, bool active=false)