+int AliHLTSystem::PrintBenchmarking(TObjArray* pStopwatches, int bClean)
+{
+ // see header file for class documentation
+ int iInitialized=1;
+ if (pStopwatches==NULL) return 0;
+
+ for (int i=0; i<(int)AliHLTComponent::kSWTypeCount; i++) {
+ if (!dynamic_cast<TStopwatch*>(pStopwatches->At(i))) {
+ iInitialized=0;
+ break;
+ }
+ }
+
+ if (iInitialized!=0) {
+ HLTInfo("HLT statistics:\n"
+ " base: R:%.3fs C:%.3fs\n"
+ " input: R:%.3fs C:%.3fs\n"
+ " output: R:%.3fs C:%.3fs\n"
+ " event processing : R:%.3fs C:%.3fs"
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWBase))->RealTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWBase))->CpuTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWInput))->RealTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWInput))->CpuTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWOutput))->RealTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWOutput))->CpuTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWDA))->RealTime()
+ , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWDA))->CpuTime()
+ );
+ }
+
+ if (bClean) {
+ for (int i=0; i<(int)AliHLTComponent::kSWTypeCount; i++) {
+ TObject* pObj=pStopwatches->RemoveAt(i);
+ if (pObj) delete pObj;
+ }
+ }
+ return 0;
+}
+