diff options
author | Epoch Qwert <epoch@53flpnlls43fcguy.onion> | 2014-11-23 14:25:42 -0600 |
---|---|---|
committer | Epoch Qwert <epoch@53flpnlls43fcguy.onion> | 2014-11-23 14:25:42 -0600 |
commit | 30300843e0c66ca3eefa97f5787f95b07c256d2f (patch) | |
tree | b29343b30092689786ffcac3913b683ff7555dbe /nocompile/bin/elapsedtime | |
parent | a23b5f921d551863dbcae494e58622164a1d3492 (diff) | |
download | misc-30300843e0c66ca3eefa97f5787f95b07c256d2f.tar.gz misc-30300843e0c66ca3eefa97f5787f95b07c256d2f.zip |
fixed gitignore. >_> added a bunch of new piddly shit.
Diffstat (limited to 'nocompile/bin/elapsedtime')
-rwxr-xr-x | nocompile/bin/elapsedtime | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nocompile/bin/elapsedtime b/nocompile/bin/elapsedtime new file mode 100755 index 0000000..3d26597 --- /dev/null +++ b/nocompile/bin/elapsedtime @@ -0,0 +1,18 @@ +#!/bin/sh +if [ "_$1" != "_" ];then + time=$1 +else + read time +fi + +partials=$(echo $time | cut -d. -f2) +wholes=$(echo $time | cut -d. -f1) +seconds=$(( wholes % 60 )) +minutes=$(( wholes/60 % 60 )) +hours=$(( wholes/60/60 % 24 )) +days=$(( wholes/60/60/24 % 7 )) +weeks=$(( wholes/60/60/24/7 )) +echo $weeks weeks $days days $hours:$minutes:$seconds.$partials +if read time;then + elapsedtime $time +fi |