Demonstrates how to test a simple timer without spending time.sleep()
.
Optionally, create a virtual environment for this example and activate it.
python -m venv timer_venv # assuming Python 3
. timer_venv/bin/activate
Then install the example dependencies (only stime
in fact):
pip install -r requirements.txt
# activate the virtual environment if you use one:
. timer_venv/bin/activate
# run the example test suite:
python test_timer.py
# once you're done deactivate the virtual environment if you use one:
deactivate