| 85 | } |
| 86 | |
| 87 | std::string Utility::formatTime(double seconds) { |
| 88 | |
| 89 | if (seconds <= 0) { |
| 90 | return "00:00:00"; |
| 91 | } |
| 92 | |
| 93 | int h((int) seconds / 3600); |
| 94 | int min((int) seconds / 60 - h * 60); |
| 95 | int sec((int) seconds - (h * 60 + min) * 60); |
| 96 | |
| 97 | std::ostringstream oss; |
| 98 | oss << std::setfill('0') << std::setw(2) << h << ":"; |
| 99 | oss << std::setfill('0') << std::setw(2) << min << ":"; |
| 100 | oss << std::setfill('0') << std::setw(2) << sec; |
| 101 | |
| 102 | return oss.str(); |
| 103 | } |
| 104 | |
| 105 | std::string Utility::formatTimeShort(double seconds) { |
| 106 |
nothing calls this directly
no outgoing calls
no test coverage detected