Created
June 29, 2023 07:55
-
-
Save boychaboy/5d534c0597aea2105e1e322a8b7948d9 to your computer and use it in GitHub Desktop.
python iteration에서 상태바, 총 소요 시간을 보여주는 기본 코드
This file contains 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
import tqdm | |
start = time.time() | |
with tqdm.tqdm(total=len(inputs)) as pbar: | |
for batch_inputs in batch(inputs, BATCH_SIZE): | |
# do something | |
pbar.update(len(batch_inputs)) | |
end = time.time() | |
print(f"Time elapsed: {end-start:.3f} seconds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment