]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
division by 0 protected
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Nov 2010 13:11:14 +0000 (13:11 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Nov 2010 13:11:14 +0000 (13:11 +0000)
HLT/BASE/util/AliHLTComponentBenchmark.cxx

index 817de4dfc5f74d3c64f186eafab2e531ea11d469..ef79df17f6d986641d0ed3415f3887381c534c73 100644 (file)
@@ -110,7 +110,8 @@ const char *AliHLTComponentBenchmark::GetStatistics()
                     fComponentName.Data(), fNEvents, fTotalInput/fNEvents/1024, fTotalOutput/fNEvents/1024, ratio);
   
   if( fNTimers<=0 ) return fStatistics.Data();
-  fStatistics+=Form("; Time %.1fms/%.1fHz (real/cpu = ",fTotalRealTime[0]/fNEvents*1.e3,fNEvents/fTotalRealTime[0]);
+  float hz = ( fTotalRealTime[0] > 0 ) ?fNEvents/fTotalRealTime[0] : 0;
+  fStatistics+=Form("; Time %.1fms/%.1fHz (real/cpu = ",fTotalRealTime[0]/fNEvents*1.e3,hz);
   
   for( int i=0; i<fNTimers; i++ ){
     if( i>0 ) fStatistics+=", ";