【发布时间】:2014-01-08 23:15:36
【问题描述】:
我正在寻找一些在我的 android 设备上运行的自动化脚本/工具来计算准确的网页加载时间。我尝试使用 qpython 编写脚本,但没有成功。我有大约 5 个测试 URL 来验证它们在默认浏览器和 google crome 浏览器上的完整加载时间。我需要进行 10 次迭代来计算每个 URL 的平均加载时间。请帮忙。 设备 - 安卓 网址 - Msn.com、cnn.com.. 浏览器 - 默认设备浏览器,crom 迭代-10
【问题讨论】:
-
我写了一个 python 脚本来计算每个网页加载的时间,但它不适用于 QPython 请帮助。或任何其他我可以在 android 设备上运行此程序的工具。 'from urllib.request import urlopen import time url = ["msn.com","http://www.cnn.com","http://… for i in range(0,5): for x in url: nf = urlopen(x) start = time.time() page = nf.read() end = time.time() lt = (end - start) print (x,round(lt,2)) nf.close()'
-
from urllib.request import urlopen import time url = ["http://www.msn.com","http://www.cnn.com","http://www.google.com"] for i in range(0,5): for x in url: nf = urlopen(x) start = time.time() page = nf.read() end = time.time() lt = (end - start) print (x,round(lt,2)) nf.close()
标签: android python url performance-testing