Just a small project, used for finding out how long each line of code actually takes.
The usage is sort of confusing, this is because this module uses metatables and methods to track the lua execution.
local lp = require(script.LineProfiler)
local function func_to_test(x)
local count = __incl(0)
for i=1, x do
count += i
end
return count
end
local profiled = lp.ProfileFunction(func_to_test)
profiled(100)
(NOTE: this becomes easier to implement if you use tables as they’re auto tracked)
the __incl statement will include a variable’s operations in the final output.
local function table_ops(n)
local t = __incl({})
for i = 1, n do
t[i] = i * 2
end
local sum = __incl(0)
for i = 1, n do
sum += t[i]
end
return sum
end
Shown is the output of a profiled function for a small project im working on.

The hits table show how many times a certain line of code has been executed, and the TimeSpent shows the time spent on that line.
Also, all arguments are auto-tracked (to the function)
If you need any help using the module, let me know!



