kinabalu/obsidian-word-sprint

When writing for less than a minute, the average words per minute is a divide by zero

kinabalu opened this issue · 2 comments

When writing for less than a minute, the average words per minute is a divide by zero

Unless I've completely lost it, changing the averageWordsPerMinute calculation to this ought to solve it for all cases where elapsedMilliseconds is not 0:

averageWordsPerMinute: this.getWordCountDisplay() * 1000 * 60 / Math.floor(this.elapsedMilliseconds)

fixed in 0.0.20