mirror of
https://github.com/logos-blockchain/logos-blockchain-simulations.git
synced 2026-01-31 19:33:07 +00:00
9 lines
280 B
Python
9 lines
280 B
Python
from datetime import timedelta
|
|
|
|
|
|
def format_elapsed_time(elapsed_time: float) -> str:
|
|
td = timedelta(seconds=elapsed_time)
|
|
hours, reminder = divmod(td.seconds, 3600)
|
|
minutes, seconds = divmod(reminder, 60)
|
|
return f"{td.days}d{hours:02}h{minutes:02}m{seconds:02}s"
|