mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-29 10:17:30 +08:00
calculating burst based on input length, not word
This commit is contained in:
parent
7c21991cd9
commit
2735673d95
1 changed files with 3 additions and 7 deletions
|
|
@ -280,13 +280,9 @@ export function setLastSecondNotRound(): void {
|
|||
export function calculateBurst(): number {
|
||||
const timeToWrite = (performance.now() - TestInput.currentBurstStart) / 1000;
|
||||
let wordLength;
|
||||
if (Config.mode === "zen") {
|
||||
wordLength = TestInput.input.current.length;
|
||||
if (wordLength == 0) {
|
||||
wordLength = TestInput.input.getHistoryLast().length;
|
||||
}
|
||||
} else {
|
||||
wordLength = TestWords.words.getCurrent().length;
|
||||
wordLength = TestInput.input.current.length;
|
||||
if (Config.mode === "zen" && wordLength == 0) {
|
||||
wordLength = TestInput.input.getHistoryLast().length;
|
||||
}
|
||||
const speed = Misc.roundTo2((wordLength * (60 / timeToWrite)) / 5);
|
||||
return Math.round(speed);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue