Skip to content

Commit

Permalink
avoid a divide by zero when duration is too short.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanntm committed Mar 29, 2024
1 parent f6e2983 commit 6b3c969
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public synchronized void setStates(int states) {
}

public String toString() {
return type +" walk for " + steps + " steps ("+resets +" resets) in " + duration + " ms. (" + (steps/duration) + " steps per ms)" + (states>0 ? " saw "+states + " states" :"");
return type +" walk for " + steps + " steps ("+resets +" resets) in " + duration + " ms. (" + (steps/(duration+1)) + " steps per ms)" + (states>0 ? " saw "+states + " states" :"");
}
}

Expand Down

0 comments on commit 6b3c969

Please sign in to comment.