summaryrefslogtreecommitdiff
path: root/test/test_stopwatch.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_stopwatch.py')
-rwxr-xr-xtest/test_stopwatch.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_stopwatch.py b/test/test_stopwatch.py
new file mode 100755
index 0000000..6ff2c0e
--- /dev/null
+++ b/test/test_stopwatch.py
@@ -0,0 +1,16 @@
+from home.util import Stopwatch, StopwatchError
+from time import sleep
+
+
+if __name__ == '__main__':
+ s = Stopwatch()
+ s.go()
+ sleep(2)
+ s.pause()
+ s.go()
+ sleep(1)
+ print(s.get_elapsed_time())
+ sleep(1)
+ print(s.get_elapsed_time())
+ s.pause()
+ print(s.get_elapsed_time())