Skip to content

Commit

Permalink
little bit of magic
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Nov 25, 2024
1 parent dff5aa9 commit d93c674
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ElvUI_Libraries/Core/oUF/simpy/profiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,21 @@ _info.funcs = _funcs
_info.data = _data
_info.fps = _fps

local depth = 0
local debug = function(num, start)
depth = depth + num

if num == -1 and (depth % 2 == 1) then
return start
else
return debugprofilestop()
end
end

local Profile = function(func, ...)
local start = debugprofilestop()
local start = debug(1)
local args = { func(...) }
local finish = debugprofilestop() - start
local finish = debug(-1, start) - start

return start, finish, args
end
Expand Down

0 comments on commit d93c674

Please sign in to comment.