Skip to content

Commit f56c230

Browse files
human format the time elapsed better
1 parent 3fad40f commit f56c230

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

misc/perf_compare.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ def main() -> None:
213213
delta = f"{d:+.1%}"
214214
print(f"{commit:<25} {tt:.3f}s ({delta}) | stdev {s:.3f}s ")
215215

216-
print(f"Total time taken by the benchmarking program (including any setup): {time.time() - whole_program_time_0:.2f}s")
216+
t = int( time.time() - whole_program_time_0 )
217+
total_time_taken_formatted = ", ".join(
218+
f"{v} {n if v==1 else n+'s'}" for v, n in ((t//3600, "hour"), (t//60%60, "minute"), (t%60, "second")) if v
219+
)
220+
print(f"Total time taken by the whole benchmarking program (including any setup):", total_time_taken_formatted)
217221

218222
shutil.rmtree(check_dir)
219223
for target_dir in target_dirs:

0 commit comments

Comments
 (0)