avoid division by zero when calculating runtime