From d004aa9b4f183ed79fc4463ff43ce7a3a34c0477 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Wed, 4 Jun 2014 20:23:23 +0000 Subject: [PATCH] Improve display of profilng statistics. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1510 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Profiler.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Profiler.lua b/Profiler.lua index eeebc11..e0f7e32 100644 --- a/Profiler.lua +++ b/Profiler.lua @@ -129,10 +129,10 @@ end function Profiler:Reset() for tag in pairs(self_timeSpent) do - self_timeSpent[tag] = 0 + self_timeSpent[tag] = nil end for tag in pairs(self_timesInvoked) do - self_timesInvoked[tag] = 0 + self_timesInvoked[tag] = nil end end @@ -142,7 +142,7 @@ do function Profiler:Info() if next(self_timeSpent) then local now = API_GetTime() - Ovale:FormatPrint("Profiler info at %f:", now) + Ovale:FormatPrint("Profiling statistics at %f:", now) -- Calculate the width needed to print out the times invoked. local width = 1 @@ -157,10 +157,10 @@ do end wipe(array) - local formatString = format(" %%6fs: %%%dd x %%s", width) + local formatString = format(" %%08.3fms: %%0%dd (%%05f) x %%s", width) for tag, timeSpent in pairs(self_timeSpent) do local timesInvoked = self_timesInvoked[tag] - tinsert(array, format(formatString, timeSpent/1000, timesInvoked, tag)) + tinsert(array, format(formatString, timeSpent, timesInvoked, timeSpent / timesInvoked, tag)) end if next(array) then tsort(array) -- 1.7.9.5