aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/interrupt.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-12-05 10:14:07 +0100
committerorwell96 <orwell@bleipb.de>2019-12-05 10:15:36 +0100
commiteeef07d05a7e53de469f19a23fe1e69f569fc924 (patch)
tree6330ae717f337ec1a039004349d9c4c045ab632c /advtrains_luaautomation/interrupt.lua
parent9c1d3565058799f21b6985c100ccf1abe045d3da (diff)
downloadadvtrains-eeef07d05a7e53de469f19a23fe1e69f569fc924.tar.gz
advtrains-eeef07d05a7e53de469f19a23fe1e69f569fc924.tar.bz2
advtrains-eeef07d05a7e53de469f19a23fe1e69f569fc924.zip
Add profiling instructions for advprofiler
Diffstat (limited to 'advtrains_luaautomation/interrupt.lua')
-rw-r--r--advtrains_luaautomation/interrupt.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains_luaautomation/interrupt.lua b/advtrains_luaautomation/interrupt.lua
index 525c3b4..3f7aba4 100644
--- a/advtrains_luaautomation/interrupt.lua
+++ b/advtrains_luaautomation/interrupt.lua
@@ -22,6 +22,7 @@ function iq.add(t, pos, evtdata)
end
function iq.mainloop(dtime)
+ atlatc.profiler:enter("iq_mainloop")
timer=timer + math.min(dtime, 0.2)
for i=1,#queue do
local qe=queue[i]
@@ -33,7 +34,9 @@ function iq.mainloop(dtime)
local node=advtrains.ndb.get_node(pos)
local ndef=minetest.registered_nodes[node.name]
if ndef and ndef.luaautomation and ndef.luaautomation.fire_event then
+ atlatc.profiler:enter("iq_run_single_event")
ndef.luaautomation.fire_event(pos, evtdata)
+ atlatc.profiler:leave("iq_run_single_event")
else
atwarn("[atlatc][interrupt] Couldn't run event",evtdata.type,"on",pos,", something wrong with the node",node)
end
@@ -41,6 +44,7 @@ function iq.mainloop(dtime)
i=i-1
end
end
+ atlatc.profiler:leave("iq_mainloop")
end