Update updateWPM

This commit is contained in:
Shadowfacts 2016-10-08 14:12:33 -04:00
parent 4ce5e72ccb
commit e3643656ef
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 9 deletions

View File

@ -570,15 +570,8 @@ function updateWPM() {
let words = typed.split(/[\s,\.]+/).length;
let seconds = elapsedTime / 1000;
if (seconds >= 60) {
// update real WPM
let minutes = seconds / 60;
$("#wpm").text(Math.round(words / minutes));
} else {
// extrapolate forwards
let scaledWords = words / (seconds / 60);
$("#wpm").text(Math.round(scaledWords));
}
let minutes = seconds / 60;
$("#wpm").text(Math.round(words / minutes));
}
function pause() {