From d468d76b542b1f964575163607cd1cce9de95b8f Mon Sep 17 00:00:00 2001 From: Fierelier Date: Fri, 19 Mar 2021 03:18:18 +0100 Subject: [PATCH] Time stuff for debug --- BirdyNet.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BirdyNet.py b/BirdyNet.py index 565d268..1f08386 100644 --- a/BirdyNet.py +++ b/BirdyNet.py @@ -26,6 +26,7 @@ from qtpy.QtCore import * from qtpy.QtMultimedia import QSound import configparser import json +import time os.chdir(sp) distro = os.path.splitext(s.rsplit(os.path.sep)[-1])[0] @@ -119,12 +120,20 @@ class browserWindow(QMainWindow): def cNavigate(self,event = None): try: - print(prettyJson(parseUrl(self.cUrlBar.text()))) + #print(prettyJson(parseUrl(self.cUrlBar.text()))) + start = time.time() response = downloadPage(self.cUrlBar.text(),{"User-Agent": self.cUserAgent}) + end = time.time() + print("Downloading page: " +str(end - start)) + infoFetcher(response) self.cDocumentInfo = response + + start = time.time() self.cDoc.cRenderHtml(response["body"].decode("utf-8",errors="ignore")) - print(prettyJson(response["headers"])) + end = time.time() + print("Rendering page: " +str(end - start)) + #print(prettyJson(response["headers"])) except Exception as e: self.cDoc.cRenderHtml(str(e)) raise