开发者

Chickenfoot JS question

开发者 https://www.devze.com 2022-12-13 21:49 出处:网络
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 extensio

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消