summaryrefslogtreecommitdiff
path: root/script-beta/vm/getInfer.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/vm/getInfer.lua')
-rw-r--r--script-beta/vm/getInfer.lua9
1 files changed, 8 insertions, 1 deletions
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({'<nil>'}, { __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