summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-12-27 19:30:19 +0000
committerdavidovski <david@davidovski.xyz>2023-12-27 19:30:19 +0000
commit46dc0722229aa8468a01642151300df007eea271 (patch)
treede73c9bc9ced3d59b3bdcd2883183cbb51e2b2d2
parentf375439b5d11400b26f7bf939ab7821ef787fe54 (diff)
fix wpm calculation
-rwxr-xr-xtypr.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/typr.sh b/typr.sh
index c45a25d..cb404aa 100755
--- a/typr.sh
+++ b/typr.sh
@@ -106,7 +106,7 @@ typr_show_results () {
time_ns=$((now-start))
words="$(set -- $text ; printf "%s" "$#")"
- wpm="$((time_ns*words/60000000000))"
+ wpm="$((words*60000000000/time_ns))"
acc="$(typr_calculate_acc)"
printf "[%s;${areax}H%s" \
@@ -189,7 +189,7 @@ typr_main () {
while true; do
case "$(tty_readc)" in
- ' '|'') break;;
+ ''|'') break;;
esac
done
}