- Problem solving. To quickly check different implementations and compare versions to find which one performs better.
- Quick algorithm mockup. Again, to quickly check different approaches and implementations and compare versions to find which one performs better.
- Overall performance score of your application.
- Algorithmic complexity.
import time
import test_timer
def function_a():
...
def function_b():
time.sleep(1)
class TestSrc(test_timer.BenchTestCase):
def test_function_a(self):
function_a()
def test_function_b(self):
function_b()
if __name__ == "__main__":
test_timer.main()
test_function_a (__main__.TestSrc): 0:00:00.000052
.
test_function_b (__main__.TestSrc): 0:00:01.001192
.
----------------------------------------------------------------------
Ran 2 tests in 1.002s
OK
pip install test_timer