Browse Source

Update updateWPM

master
Shadowfacts 5 years ago
parent
commit
e3643656ef
Signed by: shadowfacts GPG Key ID: 94A5AB95422746E5
  1. 11
      js/type.js

11
js/type.js

@ -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() {

Loading…
Cancel
Save