()
| 324 | |
| 325 | |
| 326 | def _stop_current_profiler(): |
| 327 | global _running_profiler |
| 328 | if _running_profiler is not None: |
| 329 | _running_profiler.stop() |
| 330 | living_profilers = [*_living_profilers] |
| 331 | for profiler in living_profilers: |
| 332 | profiler.dump() |
| 333 | |
| 334 | |
| 335 | _atexit(_stop_current_profiler) |