Implement profiler

This commit is contained in:
2026-06-20 14:21:26 +03:00
parent 45a09284c2
commit ab48b57e1b
10 changed files with 294 additions and 17 deletions
+15
View File
@@ -0,0 +1,15 @@
for i = 1, 100 do
profiler.start("math_work")
local x = 0
for j = 1, 200000 do x = x + math.sqrt(j) end
profiler.stop("math_work")
profiler.start("string_work")
local s = ""
for j = 1, 2000 do s = s .. tostring(j) end
profiler.stop("string_work")
end
for _, r in ipairs(profiler.results()) do
print(r.label, r.time)
end