Code: Select all
$(function ()
{
$(document).keydown(function (k)
{
realWPM = Math.round((error_keystrokes / 5) / ((60.01 - countdown) / 60));
if(realWPM < 0 || realWPM > 400)
{
realWPM = 0;
}
$('#preview').html("<font size='+3'><b>WPM:</b> " +
realWPM + "<br><b>Key Strokes:</b> " +
error_keystrokes + "<br><b>Words:</b> " +
error_correct + "</<font size='+3'>");
$('#words').before("<div id='preview'></div>");
})
})
(To use this press CNTRL + SHIFT + I, click on console, paste the code, press ENTER and start typing!)
//- Fixed: inaccurate scores in the first few seconds.
Screenshot: http://prntscr.com/im0hw6