()
| 152 | if current_process()._name == 'MainProcess': |
| 153 | @atexit.register |
| 154 | def on_shutdown(): |
| 155 | if bench_first is not None and bench_last is not None: |
| 156 | print('- Time spent in benchmark: {!r}'.format( |
| 157 | bench_last - bench_first)) |
| 158 | print('- Avg: {}'.format( |
| 159 | sum(bench_sample) / len(bench_sample))) |
| 160 | memdump() |
| 161 | |
| 162 | def task_reserved(request): |
| 163 | """Called when a task is reserved by the worker.""" |