timeing info on switching station

This commit is contained in:
Thomas Rudin 2018-10-16 13:27:21 +02:00
parent 26474b3f5c
commit 80e9e44099

View File

@ -404,6 +404,12 @@ minetest.register_abm({
meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor)) meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor))
--dprint("Charging battery:"..math.floor(eu_demand*charge_factor)) --dprint("Charging battery:"..math.floor(eu_demand*charge_factor))
end end
local t1 = minetest.get_us_time()
local diff = t1 - t0
if diff > 50000 then
minetest.log("warning", "[technic] [+supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end
return return
end end
@ -427,6 +433,11 @@ minetest.register_abm({
meta1:set_int(eu_input_str, math.floor(eu_supply * charge_factor)) meta1:set_int(eu_input_str, math.floor(eu_supply * charge_factor))
--dprint("Discharging battery:"..math.floor(eu_supply*charge_factor)) --dprint("Discharging battery:"..math.floor(eu_supply*charge_factor))
end end
local t1 = minetest.get_us_time()
local diff = t1 - t0
if diff > 50000 then
minetest.log("warning", "[technic] [-supply] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end
return return
end end
@ -447,7 +458,7 @@ minetest.register_abm({
local t1 = minetest.get_us_time() local t1 = minetest.get_us_time()
local diff = t1 - t0 local diff = t1 - t0
if diff > 100000 then -- 100ms if diff > 50000 then -- 50ms
minetest.log("warning", "[technic] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos)) minetest.log("warning", "[technic] switching station abm took " .. diff .. " us at " .. minetest.pos_to_string(pos))
end end