Inspect.Addon.Cpu
From Riftui Wiki
Returns a table with the recent CPU usage. It is separated by individual addon, then by usage within that addon. See return values for a detailed table format.
Contents |
Signature
usage = Inspect.Addon.Cpu()
Parameters
None.
Return Value
usage (table) - A table of addon identifiers paired with a table of cpu usage information. Usage is measured as a fraction of one.
-- Structure of returned table. table = { AddonIdentifier = { SubIdentifier = cpu_usage_as_fraction_of_one }, }
Example
local function GetUsage() -- Get a list of recent CPU usage -- local cpu_usage = Inspect.Addon.Cpu() -- Get our addon's usage information -- local addon_usage = cpu_usage[Inspect.Addon.Current()] -- Print out each subidentifier and it's usage -- for v, k in pairs(addon_usage) do -- this will print out "Identifier, 0.0000000%" -- print(tostring(v) .. ", " .. string.format("%08f%%", k)) end end