summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-12-28 14:03:30 +0000
committerdavidovski <david@davidovski.xyz>2023-12-28 14:03:30 +0000
commit1eb30f205f776ad812fd6c6c8d81dd666531b8dc (patch)
tree89264f3c1a6e167de5acaa85c8a1a27f41d140f3
parent55da2672077e95cfef581901676f5805b6a46205 (diff)
use reverse timer on timed tests
-rwxr-xr-xtypr.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/typr.sh b/typr.sh
index 82678e6..d1748ca 100755
--- a/typr.sh
+++ b/typr.sh
@@ -62,6 +62,10 @@ typr_draw_time () {
case "$test_type" in
"time")
time_ns=$((1000000000*$test_length - $time_ns))
+ [ "$time_ns" -lt "0" ] && {
+ [ "$(((time_ns / 500000000) % 2))" = "0" ] && printf "[$((areay - 1));${areax}H%s" " " && return 1
+ time_ns=0
+ }
;;
esac