summaryrefslogtreecommitdiff
path: root/get_playtime.sh
diff options
context:
space:
mode:
Diffstat (limited to 'get_playtime.sh')
-rwxr-xr-xget_playtime.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/get_playtime.sh b/get_playtime.sh
new file mode 100755
index 0000000..9ca3e70
--- /dev/null
+++ b/get_playtime.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env sh
+
+IFS=$'\n'
+TOTAL=0
+for I in $(ls -1 playtime 2>/dev/null); do
+ TOTAL=$(echo $(cat "playtime/${I}") + "${TOTAL}" | nickle)
+done
+
+echo Total seconds: ${TOTAL}
+echo Total minutes: $(echo ${TOTAL} / 60 | nickle)
+echo Total hours: $(echo ${TOTAL} / 60 / 60 | nickle)
+echo Total days: $(echo ${TOTAL} / 60 / 60 / 24 | nickle)
+echo Total years: $(echo ${TOTAL} / 60 / 60 / 24 / 365.25 | nickle)