From 80e9e44099a573420c58eae034048ab1964179ac Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Tue, 16 Oct 2018 13:27:21 +0200 Subject: [PATCH] timeing info on switching station --- technic/machines/switching_station.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 7f5cf31..7434595 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -404,6 +404,12 @@ minetest.register_abm({ meta1:set_int(eu_input_str, math.floor(eu_demand * charge_factor)) --dprint("Charging battery:"..math.floor(eu_demand*charge_factor)) 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 end @@ -427,6 +433,11 @@ minetest.register_abm({ meta1:set_int(eu_input_str, math.floor(eu_supply * charge_factor)) --dprint("Discharging battery:"..math.floor(eu_supply*charge_factor)) 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 end @@ -447,7 +458,7 @@ minetest.register_abm({ local t1 = minetest.get_us_time() 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)) end