Time stuff for debug

This commit is contained in:
Fierelier 2021-03-19 03:18:18 +01:00
parent b9815f4976
commit d468d76b54
1 changed files with 11 additions and 2 deletions

View File

@ -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