Skip to content

Commit

Permalink
Fix mean 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 12, 2021
1 parent 875a2f2 commit 8b963a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/run/preview/results/duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const getSamplesLeft = function (
{ samples, loops, mean, stdev },
precisionTarget,
) {
if (mean === 0) {
return 0
}

const moeTarget = precisionTarget * mean
const lengthTarget = getLengthForMoe(moeTarget, stdev)
const loopsTarget = Math.min(getLoopsFromLength(lengthTarget), MAX_MEASURES)
Expand Down

0 comments on commit 8b963a3

Please sign in to comment.