From faab8b0541b7eb3a955dfc231f91364f78d0fcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 17 Aug 2020 17:02:09 +0800 Subject: =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E7=9A=84=E7=93=B6=E9=A2=88=E5=9C=A8?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8E=A8=E6=96=AD=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/vm/getInfer.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script-beta/vm/getInfer.lua b/script-beta/vm/getInfer.lua index 7eb65df4..0352e9d2 100644 --- a/script-beta/vm/getInfer.lua +++ b/script-beta/vm/getInfer.lua @@ -1,5 +1,6 @@ local vm = require 'vm.vm' local guide = require 'parser.guide' +local util = require 'utility' NIL = setmetatable({''}, { __tostring = function () return 'nil' end }) @@ -26,5 +27,11 @@ function vm.getInfers(source) if not source then return end - return guide.requestInfer(source, vm.interface) + local clock = os.clock() + local infers = guide.requestInfer(source, vm.interface) + local passed = os.clock() - clock + if passed > 0.1 then + log.warn(('Request infer takes [%.3f]sec! %s'):format(passed, util.dump(source, { deep = 1 }))) + end + return infers end -- cgit v1.2.3