]> git.scottworley.com Git - keystroke-timestamps/blobdiff - gaps.sh
Specify time_fmt more succinctly
[keystroke-timestamps] / gaps.sh
diff --git a/gaps.sh b/gaps.sh
index cf951049217ebf8e1e13fda0fb643612f728bc94..2d28af92a2cc6ba22d5fbb41325a2c28d546b8b0 100755 (executable)
--- a/gaps.sh
+++ b/gaps.sh
@@ -3,10 +3,7 @@
 threshold=${1:-3600}
 LOGFILE="${2:-$HOME/keystroke-timestamps.log}"
 
-awk -vthreshold="$threshold" '
-  BEGIN {
-    time_fmt = "%F %T"
-  }
+awk -vthreshold="$threshold" -vtime_fmt="%F %T" '
   {
     if (prev && $1 - prev > threshold) {
       print(strftime(time_fmt, prev), "to", strftime(time_fmt, $1), "was", $1 - prev)