From: Stefan Huber Date: Sat, 9 Nov 2013 15:35:09 +0000 (+0100) Subject: Add timer.py X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=e1848caa002c648e916283cda251032391f71861;p=shutils.git Add timer.py --- diff --git a/timer.py b/timer.py new file mode 100644 index 0000000..4f842e7 --- /dev/null +++ b/timer.py @@ -0,0 +1,118 @@ +#!/usr/bin/python3 + +import sys +import time +import datetime + +units = {"s" : 1, "m" : 60, "h" : 60*60, "d" : 24*60*69 } + +def reprint(value, file=sys.stdout, end=""): + print("\r" + value, file=file, end=end) + + +def usage(): + print("""Usage: {0} [--reverse] [--offset