IAP GITLAB

Skip to content
Snippets Groups Projects

Resolve "Summary file doesn't account for day roll over"

Merged Alan Coleman requested to merge 690-summary-file-doesn-t-account-for-day-roll-over into master
All threads resolved!
1 file
+ 6
3
Compare changes
  • Side-by-side
  • Inline
@@ -133,13 +133,16 @@ namespace corsika {
@@ -133,13 +133,16 @@ namespace corsika {
auto end_time{std::chrono::system_clock::now()};
auto end_time{std::chrono::system_clock::now()};
// now let's construct an estimate of the runtime
// calculate the number of days
auto runtime{end_time - start_time};
auto const start_t = std::chrono::system_clock::to_time_t(start_time);
 
auto const end_t = std::chrono::system_clock::to_time_t(end_time);
 
int const durationDays = std::difftime(end_t, start_t) / (60 * 60 * 24);
// add the time and duration info
// add the time and duration info
summary["start time"] = timeToString(start_time);
summary["start time"] = timeToString(start_time);
summary["end time"] = timeToString(end_time);
summary["end time"] = timeToString(end_time);
summary["runtime"] = fmt::format("{:%H:%M:%S}", runtime);
summary["runtime"] = (durationDays ? fmt::format("+{}d ", durationDays) : "") +
 
fmt::format("{:%H:%M:%S}", end_time - start_time);
return summary;
return summary;
}
}
Loading