From 37391cdd8171d70bcdbb90846636c0fb68b67be3 Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 12 Apr 2019 14:17:31 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/value.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/src/vm/value.lua') diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 9ffd55bc..7eb7784e 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -410,6 +410,7 @@ function mt:addInfo(tp, source, ...) end function mt:eachInfo(callback) + local clock = os.clock() local infos = self._info local list = {} for srcId, info in pairs(infos) do @@ -426,6 +427,10 @@ function mt:eachInfo(callback) table.sort(list, function (a, b) return a._sort < b._sort end) + local passed = os.clock() - clock + if passed > 0.1 then + log.warn(('eachInfo takes: [%.3f]sec, #list: %d'):format(passed, #list)) + end for i = 1, #list do local info = list[i] local res = callback(info, listMgr.get(info.source)) -- cgit v1.2.3