From 86717de6e155718e218f3e01bc82f7f048eb4f3f Mon Sep 17 00:00:00 2001 From: Martijn Courteaux Date: Tue, 21 May 2024 19:24:04 +0200 Subject: [PATCH] Improve time comparing display. --- profiler/src/profiler/TracyView_Compare.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/profiler/src/profiler/TracyView_Compare.cpp b/profiler/src/profiler/TracyView_Compare.cpp index de99f987..2e0eaac6 100644 --- a/profiler/src/profiler/TracyView_Compare.cpp +++ b/profiler/src/profiler/TracyView_Compare.cpp @@ -207,12 +207,10 @@ static void PrintSpeedupOrSlowdown( double time_this, double time_external, cons ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - char buf[64]; - memcpy( buf, "(Time factor compared to external: ", 35 ); - char *ptr = &buf[35]; - ptr = PrintFloat( ptr, buf + sizeof(buf), factor, 3 ); - memcpy( ptr, ")", 2 ); - ptr += 23; + char buf[128]; + sprintf(buf, "(this %s %c%s is %.2f%% of external %s %c%s)", + ICON_FA_LEMON, tolower( metric[0] ), metric + 1, factor * 100, + ICON_FA_GEM, tolower( metric[0] ), metric + 1 ); TextDisabledUnformatted( buf ); }