Skip to content

Commit

Permalink
fix division by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schäfer committed Sep 25, 2014
1 parent 0f278cf commit 870ae47
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ private void writeStatistics() {
printWriter.write( "Number of Failed Cases: " + statistics.numFailedCases + "<br>" );
printWriter.write( "Number of Steps: " + statistics.numSteps + "<br>" );
printWriter.write( "Total Time: " + DurationFormatter.format( statistics.durationInNanos ) + "<br>" );
printWriter.write( "Average duration per Case: "
+ DurationFormatter.format( statistics.durationInNanos / statistics.numCases ) );

long averageNanos = statistics.numCases != 0 ? statistics.durationInNanos / statistics.numCases : 0;
printWriter.write( "Average duration per Case: " + DurationFormatter.format( averageNanos ) );
}
}

0 comments on commit 870ae47

Please sign in to comment.