From b94711cb6ed8c0ce6082e9ad6db652e03871a629 Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Mon, 17 Aug 2026 18:29:58 -0700 Subject: [PATCH] src/falco_utils.hpp: if __APPLE__ is defined, the std:chrono::hh_mm_ss is not used and each part of the time output is calculated separately. This is to avoid using additional libraries which even gcc seems to need when formatting time on macos --- src/falco_utils.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/falco_utils.hpp b/src/falco_utils.hpp index 85b60fe..7888847 100644 --- a/src/falco_utils.hpp +++ b/src/falco_utils.hpp @@ -128,7 +128,17 @@ get_run_duration(const auto start_time) { std::chrono::duration_cast>(d - dm); return std::format("{}:{:05.2f}", dm.count(), ds.count()); } +#if defined(__APPLE__) + using std::chrono::floor; + const auto hrs = floor(d_ms); + const auto mins = floor(d_ms - hrs); + const auto secs = floor(d_ms - hrs - mins); + const auto milli = floor(d_ms - hrs - mins - secs); + return std::format("{:02}:{:02}:{:02}.{:03}", hrs.count(), mins.count(), + secs.count(), milli.count()); +#else return std::format("{}", std::chrono::hh_mm_ss{d_ms}); +#endif } inline constexpr auto end_module_tag = ">>END_MODULE\n";