fix(stats): more robust checks for native cputime

This commit is contained in:
Folke Lemaitre 2023-01-03 09:12:43 +01:00
parent 06db1ec3c6
commit b5f4106892
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 19 additions and 10 deletions

View file

@ -543,7 +543,7 @@ function M:profile()
local stats = require("lazy.stats").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
self:append("Startuptime: ", "LazyH2"):append(ms .. "ms", "Number"):nl():nl()
if stats.startuptime_cputime then
if stats.real_cputime then
self:append("Based on the actual CPU time of the Neovim process till "):append("UIEnter", "LazySpecial")
self:append("."):nl()
self:append("This is more accurate than ")