From c0c85bab44e119380a3429cc6b08263f276f3b24 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Tue, 29 Oct 2013 11:11:11 +0100 Subject: [PATCH] Checking appendGcode time in lua --- src/rest/api/api_printer.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rest/api/api_printer.lua b/src/rest/api/api_printer.lua index b1432a4..1506b46 100644 --- a/src/rest/api/api_printer.lua +++ b/src/rest/api/api_printer.lua @@ -228,7 +228,11 @@ function M.print_POST(request, response) local rv,msg -- TODO: return errors with a separate argument like here in the rest of the code (this is how we designed the API right?) + local startTime = os.clock() rv,msg = printer:appendGcode(argGcode) + local duration = os.clock()-startTime + log:debug(" duration: "..utils.dump(duration)) + if rv then --NOTE: this does not report the number of lines, but only the block which has just been added response:addData('gcode_append',argGcode:len())