Test sur banc
benchit.py
# -*- coding: utf-8 -*-
from benchit import BenchIt
b = BenchIt()
b.mark("Stuff Done")
for i in range(1,1000000):
b.mark("In loop")
pass # more stuff done
b.mark("More stuff completed")
b.display()
display
+----------------------+----------+------+--------+----------+---------+---------+
| Marker | Method | Line | Loops | Avg Time | Runtime | Percent |
+----------------------+----------+------+--------+----------+---------+---------+
| Stuff Done | <module> | 7 | 1 | 0.00000 | 0.00000 | 0.00 |
| In loop | <module> | 9 | 999999 | 0.00000 | 1.47100 | 89.91 |
| More stuff completed | <module> | 12 | 1 | 0.01700 | 0.01700 | 1.04 |
+----------------------+----------+------+--------+----------+---------+---------+
Recommended Posts