Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 23, 2022
1 parent 2080694 commit 68a8d57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions lua/lazy/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,21 @@ function M.track(name, time)
if name then
local entry = {
name = name,
time = time or M.time(),
time = time or vim.loop.hrtime(),
}
table.insert(M._profiles[#M._profiles], entry)

if not time then
table.insert(M._profiles, entry)
end
return entry
else
local entry = table.remove(M._profiles)
entry.time = M.time() - entry.time
entry.time = vim.loop.hrtime() - entry.time
return entry
end
end

function M.time()
return vim.loop.hrtime()
end

function M.file_exists(file)
return vim.loop.fs_stat(file) ~= nil
end
Expand Down
2 changes: 1 addition & 1 deletion lua/lazy/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function M.setup(opts)
Config.setup(opts)
Util.track()

Util.track("plugins")
Util.track("state")
if Module.changed or not State.load() then
-- rebuild state
local Plugin = require("lazy.plugin")
Expand Down

0 comments on commit 68a8d57

Please sign in to comment.