| 73 | // ── Helpers ────────────────────────────────────────────────────────────────── |
| 74 | |
| 75 | static std::string format_size(int64_t bytes) { |
| 76 | char buf[32]; |
| 77 | if (bytes >= (int64_t)1024 * 1024 * 1024) { |
| 78 | snprintf(buf, sizeof(buf), "%.1f GB", bytes / (1024.0 * 1024.0 * 1024.0)); |
| 79 | } else if (bytes >= (int64_t)1024 * 1024) { |
| 80 | snprintf(buf, sizeof(buf), "%lld MB", (long long)(bytes / (1024 * 1024))); |
| 81 | } else { |
| 82 | snprintf(buf, sizeof(buf), "%lld KB", (long long)(bytes / 1024)); |
| 83 | } |
| 84 | return buf; |
| 85 | } |
| 86 | |
| 87 | static std::string format_time_short(double ms) { |
| 88 | if (ms < 0) return " -"; |
no outgoing calls
no test coverage detected