Time stuff for debug

This commit is contained in:
Fierelier 2021-03-19 03:18:18 +01:00
parent b9815f4976
commit d468d76b54

View File

@ -26,6 +26,7 @@ from qtpy.QtCore import *
from qtpy.QtMultimedia import QSound from qtpy.QtMultimedia import QSound
import configparser import configparser
import json import json
import time
os.chdir(sp) os.chdir(sp)
distro = os.path.splitext(s.rsplit(os.path.sep)[-1])[0] distro = os.path.splitext(s.rsplit(os.path.sep)[-1])[0]
@ -119,12 +120,20 @@ class browserWindow(QMainWindow):
def cNavigate(self,event = None): def cNavigate(self,event = None):
try: 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}) response = downloadPage(self.cUrlBar.text(),{"User-Agent": self.cUserAgent})
end = time.time()
print("Downloading page: " +str(end - start))
infoFetcher(response) infoFetcher(response)
self.cDocumentInfo = response self.cDocumentInfo = response
start = time.time()
self.cDoc.cRenderHtml(response["body"].decode("utf-8",errors="ignore")) 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: except Exception as e:
self.cDoc.cRenderHtml(str(e)) self.cDoc.cRenderHtml(str(e))
raise raise