I am trying to make firefox automatically visit a set of webpages and report to me开发者_开发问答 somehow how much it took to load each page. My best option so far seems to be the ChickenFoot extension. The following program however always outputs the same load time (3 milliseconds):
function end_timer(start){
stop = new Date()
output("Load time:" + parseInt(stop.getTime() - start.getTime()))
}
start = new Date()
go("facebook.com")
whenLoaded(end_timer(start), this)
Does anyone have any ideas? Thanks !
Ok ppl, I found it.. I am just pasting the corrected code here in case someone wants to use it in the future:
function end_timer(start){
stop = new Date()
output("Load time:" + parseInt(stop.getTime() - start.getTime()))
}
start = new Date()
go("facebook.com")
wait()
end_timer(start)
精彩评论