control profiling with NVIM_PROFILE env variable or F1 key
This commit is contained in:
parent
e317dca789
commit
37309c0edd
6 changed files with 627 additions and 4 deletions
14
lua/profile/clock.lua
Normal file
14
lua/profile/clock.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local hrtime = vim.loop.hrtime
|
||||
|
||||
local start = hrtime()
|
||||
|
||||
return setmetatable({
|
||||
reset = function()
|
||||
start = hrtime()
|
||||
end,
|
||||
}, {
|
||||
__call = function()
|
||||
-- Microseconds
|
||||
return (hrtime() - start) / 1e3
|
||||
end,
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue