Created
July 20, 2022 12:59
-
-
Save ThomasParistech/b7e8301710fe7e5ef6b1612b6e0d78a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _profiled_batch_func(process_func: Callable[..., None], | |
| list_kwargs: List[KwargsType], | |
| shared_kwargs: KwargsType) -> List[Tuple[float, float]]: | |
| """Process and profile a batch""" | |
| profiling_events: List[Tuple[float, float]] = [] | |
| for kwargs in list_kwargs: | |
| start_time = time.perf_counter() | |
| process_func(**kwargs, **shared_kwargs) | |
| end_time = time.perf_counter() | |
| profiling_events.append((start_time, end_time)) | |
| return profiling_events |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment