From 68a8d57b5b777833d14260a8ec757077a463c62b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 23 Nov 2022 16:10:16 +0100 Subject: [PATCH] chore: cleanup --- lua/lazy/core/util.lua | 10 ++++------ lua/lazy/init.lua | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 69938d5..2da728b 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -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 diff --git a/lua/lazy/init.lua b/lua/lazy/init.lua index 35071d1..db147a7 100644 --- a/lua/lazy/init.lua +++ b/lua/lazy/init.lua @@ -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")