* @brief Formats a millisecond duration as HH:MM:SS. */
| 100 | * @brief Formats a millisecond duration as HH:MM:SS. |
| 101 | */ |
| 102 | static QString formatDuration(qint64 ms) |
| 103 | { |
| 104 | if (ms <= 0) |
| 105 | // code-verify off |
| 106 | return QStringLiteral("—"); |
| 107 | // code-verify on |
| 108 | |
| 109 | const qint64 totalSeconds = ms / 1000; |
| 110 | const qint64 hours = totalSeconds / 3600; |
| 111 | const qint64 minutes = (totalSeconds / 60) % 60; |
| 112 | const qint64 seconds = totalSeconds % 60; |
| 113 | |
| 114 | return QString::asprintf("%02lld:%02lld:%02lld", |
| 115 | static_cast<long long>(hours), |
| 116 | static_cast<long long>(minutes), |
| 117 | static_cast<long long>(seconds)); |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * @brief Re-formats an ISO 8601 timestamp in the DB Explorer's display style. |
no outgoing calls
no test coverage detected