mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: added profiler view
This commit is contained in:
parent
08b7e42fb0
commit
20ff5fa218
9 changed files with 81 additions and 61 deletions
|
@ -1,16 +1,16 @@
|
|||
local M = {}
|
||||
|
||||
---@alias LazyProfile {name: string, time: number, [number]:LazyProfile}
|
||||
---@alias LazyProfile {data: string|{[string]:string}, time: number, [number]:LazyProfile}
|
||||
|
||||
---@type LazyProfile[]
|
||||
M._profiles = { { name = "lazy" } }
|
||||
|
||||
---@param name string?
|
||||
---@param data (string|{[string]:string})?
|
||||
---@param time number?
|
||||
function M.track(name, time)
|
||||
if name then
|
||||
function M.track(data, time)
|
||||
if data then
|
||||
local entry = {
|
||||
name = name,
|
||||
data = data,
|
||||
time = time or vim.loop.hrtime(),
|
||||
}
|
||||
table.insert(M._profiles[#M._profiles], entry)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue