A context which add the time spent inside to the global TotalTimer.
(msg)
| 50 | |
| 51 | @contextmanager |
| 52 | def total_timer(msg): |
| 53 | """ A context which add the time spent inside to the global TotalTimer. """ |
| 54 | start = timer() |
| 55 | yield |
| 56 | t = timer() - start |
| 57 | _TOTAL_TIMER_DATA[msg].feed(t) |
| 58 | |
| 59 | |
| 60 | def print_total_timer(): |