MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / format_duration

Function format_duration

src/ifcconvert/IfcConvert.cpp:1237–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235}
1236
1237std::string format_duration(time_t start, time_t end)
1238{
1239 int seconds = (int)difftime(end, start);
1240 std::stringstream ss;
1241 int minutes = seconds / 60;
1242 seconds = seconds % 60;
1243 if (minutes > 0) {
1244 ss << minutes << " minute";
1245 if (minutes == 0 || minutes > 1) {
1246 ss << "s";
1247 }
1248 ss << " ";
1249 }
1250 ss << seconds << " second";
1251 if (seconds == 0 || seconds > 1) {
1252 ss << "s";
1253 }
1254 return ss.str();
1255}
1256
1257void write_log(bool header) {
1258 path_t log = log_stream.str();

Callers 2

IfcConvert.cppFile · 0.85
init_input_fileFunction · 0.85

Calls 1

strMethod · 0.45

Tested by

no test coverage detected