From bde5939b2f1eb5c04c1ab429a79fa799c3bfee28 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 26 Feb 2024 18:46:21 +0100 Subject: implement printing fractions for corrade's Debug{} --- src/chunk-region.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/chunk-region.cpp b/src/chunk-region.cpp index 0006285d..5b15b7e2 100644 --- a/src/chunk-region.cpp +++ b/src/chunk-region.cpp @@ -3,6 +3,7 @@ #include "world.hpp" #include "collision.hpp" #include "object.hpp" +#include "compat/debug.hpp" #include "compat/function2.hpp" #include #include @@ -183,9 +184,7 @@ auto chunk::make_pass_region(const pred& f, bool debug) -> pass_region if (debug) [[unlikely]] { const auto time = timeline.currentFrameTime(); - char buf[32]; - std::snprintf(buf, sizeof buf, "%.3f", 1e3*(double)time); - DBG_nospace << "region: generating for " << _coord << " took " << buf << " ms"; + DBG_nospace << "region: generating for " << _coord << " took " << fraction(1e3f*time, 3) << " ms"; } return ret; -- cgit v1.2.3