diff --git a/lua/packer/compile.lua b/lua/packer/compile.lua index 60164ec4..69ded0ac 100644 --- a/lua/packer/compile.lua +++ b/lua/packer/compile.lua @@ -85,12 +85,17 @@ local function save_profiles(threshold) end table.sort(sorted_times, function(a, b) return a[2] > b[2] end) local results = {} + local total_time = 0 for i, elem in ipairs(sorted_times) do if not threshold or threshold and elem[2] > threshold then results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' end + total_time = total_time + elem[2] end + results[#results + 1] = '' + results[#results + 1] = 'Total time: ' .. total_time .. 'ms' + _G._packer = _G._packer or {} _G._packer.profile_output = results end