diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index d4b4b948fb..5b1d993223 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -4742,10 +4742,10 @@ function WeakAuras.StartProfile() if (profileData.systems.time and profileData.systems.time.count == 1) then prettyPrint(L["Profiling already started."]); return; - else - prettyPrint(L["Profiling started."]) end + prettyPrint(L["Profiling started."]) + profileData.systems = {}; profileData.auras = {}; profileData.systems.time = {}; @@ -4762,16 +4762,13 @@ local function doNothing() end function WeakAuras.StopProfile() - if (not profileData.systems.time or not profileData.systems.time.count == 1) then + if (not profileData.systems.time or profileData.systems.time.count ~= 1) then prettyPrint(L["Profiling not running."]); return; - elseif (profileData.systems.time.count == 1) then - profileData.systems.time.count = 0; - prettyPrint(L["Profiling stopped."]) - else - prettyPrint(L["Profiling not running."]); end + prettyPrint(L["Profiling stopped."]) + profileData.systems.time.elapsed = debugprofilestop() - profileData.systems.time.start; profileData.systems.time.count = 0;