(seconds: int)
| 60 | |
| 61 | |
| 62 | def readable_time(seconds: int) -> str: |
| 63 | result = '' |
| 64 | (days, remainder) = divmod(seconds, 86400) |
| 65 | days = int(days) |
| 66 | if days != 0: |
| 67 | result += f'{days}d' |
| 68 | (hours, remainder) = divmod(remainder, 3600) |
| 69 | hours = int(hours) |
| 70 | if hours != 0: |
| 71 | result += f'{hours}h' |
| 72 | (minutes, seconds) = divmod(remainder, 60) |
| 73 | minutes = int(minutes) |
| 74 | if minutes != 0: |
| 75 | result += f'{minutes}m' |
| 76 | seconds = int(seconds) |
| 77 | result += f'{seconds}s' |
| 78 | return result |
nothing calls this directly
no outgoing calls
no test coverage detected