summary refs log tree commit diff
path: root/bin/typo.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/typo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/typo.c b/bin/typo.c
index 934be50d..66b9e007 100644
--- a/bin/typo.c
+++ b/bin/typo.c
@@ -56,12 +56,12 @@ int main() {
     time_t start = time(NULL);
     if (start < 0) err(EX_OSERR, "time");
 
-    int wordCount = 0;
+    int letterCount = 0;
     for (;;) {
         time_t now = time(NULL);
         if (now < 0) err(EX_OSERR, "time");
 
-        double wpm = (double)wordCount / difftime(now, start) * 60;
+        double wpm = (double)letterCount / 5.0 / difftime(now, start) * 60.0;
 
         char *wpmDisplay;
         int len = asprintf(&wpmDisplay, "%.2f WPM ", wpm);
@@ -79,7 +79,7 @@ int main() {
         for (size_t i = 0; i < targetsLen; ++i) {
             if (strcmp(word, targets[i])) continue;
             setTarget(i);
-            wordCount++;
+            letterCount += strlen(word);
             break;
         }
     }
b86b372535e61ca8d6ce&follow=1'>Use MakefileJune McEnroeorus.h?h=backport&id=a97f4ebf9f2b976e78282928704d6d39768b8362&follow=1'>Add tile create and access timestampsJune McEnroe 2017-07-30Assert stable struct Tile field offsetsJune McEnroe 2017-07-30Add chroot.shJune McEnroe 2017-07-30Add ` commandJune McEnroe 2017-07-30Add sshd_configJune McEnroe 2017-07-30Add termcap patchJune McEnroe