mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
ci: run_n_monitor, pretty duration with padding
When printing time durations, the smaller units can always have the same number of digits. Helps to have aligned fields when printing. Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29444>
This commit is contained in:
parent
45f19b3631
commit
d80d35ceff
1 changed files with 2 additions and 2 deletions
|
|
@ -37,9 +37,9 @@ def pretty_duration(seconds):
|
|||
hours, rem = divmod(seconds, 3600)
|
||||
minutes, seconds = divmod(rem, 60)
|
||||
if hours:
|
||||
return f"{hours:0.0f}h{minutes:0.0f}m{seconds:0.0f}s"
|
||||
return f"{hours:0.0f}h{minutes:02.0f}m{seconds:02.0f}s"
|
||||
if minutes:
|
||||
return f"{minutes:0.0f}m{seconds:0.0f}s"
|
||||
return f"{minutes:0.0f}m{seconds:02.0f}s"
|
||||
return f"{seconds:0.0f}s"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue