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)