71 {
72 MsgStream log(messageService(), name());
73
74 log << MSG::INFO << "==============================BesTimerSvc::Print===============================" << endreq;
75 unsigned int maxname=0;
76 std::vector < BesTimer* >::iterator it = m_itemList.begin();
77 for (; it != m_itemList.end(); it++) {
78 if ((*it)->name().length() > maxname) maxname = static_cast<int>((*it)->name().length());
79 if (!(*it)->propName().empty()) {
80 if ((*it)->propName().length() > maxname) maxname = static_cast<int>((*it)->propName().length());
81 }
82 }
83
84 it = m_itemList.begin();
85 for (; it != m_itemList.end(); it++) {
86 std::string nam = (*it)->name();
87 for (unsigned int i = static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i," ");
88 log << MSG::INFO << nam << " mean(t) : " << std::setw(12) << (*it)->mean()<<
89 " ms rms : " << std::setw(12) << (*it)->rms() << " ms " << endreq;
90 }
91 log << MSG::INFO << "------------------------------------------------------------------------------" << endreq;
92 it = m_itemList.begin();
93 for (; it != m_itemList.end(); it++) {
94 if (!(*it)->propName().empty()) {
95 std::string nam = (*it)->name();
96 for (unsigned int i = static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i," ");
97 log << MSG::INFO << nam << " mean(t) : " << std::setw(12) << (*it)->mean()<<
98 " ms rms : " << std::setw(12) << (*it)->rms() << " ms " << endreq;
99
100 nam = (*it)->propName();
101 for (unsigned int i = static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i," ");
102 if ((*it)->meanPropVal() == 0) {
103 log << MSG::INFO << nam << " mean(N) : " << std::setw(12) << endreq;
104 } else {
105 log << MSG::INFO << nam << " mean(N) : " << std::setw(12) << (*it)->meanPropVal() <<
106 " mean(t/N) : "
107 << 1000.*(*it)->meanTimePerObject() << " us " << endreq;
108 }
109 }
110 }
111
112 log << MSG::INFO << "==============================BesTimerSvc::Print===============================" << endreq;
113 }