From 0b0f0b55d01f13d0621f5f893e8a76ae600b2064 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 30 Jan 2023 10:19:06 +0100 Subject: [PATCH] Adjusted processing time measuring --- Backend-libXML/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Backend-libXML/main.py b/Backend-libXML/main.py index b34ce99..1af4e90 100644 --- a/Backend-libXML/main.py +++ b/Backend-libXML/main.py @@ -10,12 +10,12 @@ app = Flask(__name__) @app.route("/xpath", methods=["POST"]) def xpath(): + start = time.time_ns() request_data = request.get_json() xml = request_data['data'] xpath = request_data['process'] response = dict() - start = time.time_ns() try: response['result'] = Parser.xpath(xml, xpath) response['status'] = "OK" @@ -30,12 +30,12 @@ def xpath(): @app.route("/xsd", methods=["POST"]) def xsd(): + start = time.time_ns() request_data = request.get_json() xml = request_data['data'] xsd = request_data['process'] response = dict() - start = time.time_ns() try: response['result'] = Parser.xsd(xml, xsd) response['status'] = "OK" @@ -50,12 +50,12 @@ def xsd(): @app.route("/xslt", methods=["POST"]) def xslt(): + start = time.time_ns() request_data = request.get_json() xml = request_data['data'] xslt = request_data['process'] response = dict() - start = time.time_ns() try: response['result'] = Parser.xslt(xml, xslt) response['status'] = "OK" @@ -66,4 +66,4 @@ def xslt(): exec_time = (time.time_ns() - start) / 10**6 response['time'] = f"{exec_time:.03f}" response['processor'] = "libxml2 over lxml" - return json.dumps(response) \ No newline at end of file + return json.dumps(response)